Loading src/main/java/org/etsi/osl/tmf/ri639/model/Characteristic.java +9 −2 Changes for src/main/java/org/etsi/osl/tmf/ri639/model/Characteristic.java: 9 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -162,10 +162,17 @@ public class Characteristic extends BaseRootNamedEntity { && Objects.equals(this.type, characteristic.type); } /** * Only the name is hashed: it is set before the characteristic is persisted and never changes * afterwards. Characteristics live in Hibernate-managed Sets (e.g. Resource.resourceCharacteristic), * and Hibernate finds what to insert by looking each element up in a hash-based snapshot. Hashing * mutable state (value, id, which getId() fills in, or the lazy characteristicRelationship set) made * an updated characteristic miss that lookup, so Hibernate re-inserted its existing join-table row * and the update failed with a duplicate primary key. */ @Override public int hashCode() { return Objects.hash(id, name, valueType, characteristicRelationship, value, baseType, schemaLocation, type); return Objects.hash(name); } @Override Loading Loading
src/main/java/org/etsi/osl/tmf/ri639/model/Characteristic.java +9 −2 Changes for src/main/java/org/etsi/osl/tmf/ri639/model/Characteristic.java: 9 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -162,10 +162,17 @@ public class Characteristic extends BaseRootNamedEntity { && Objects.equals(this.type, characteristic.type); } /** * Only the name is hashed: it is set before the characteristic is persisted and never changes * afterwards. Characteristics live in Hibernate-managed Sets (e.g. Resource.resourceCharacteristic), * and Hibernate finds what to insert by looking each element up in a hash-based snapshot. Hashing * mutable state (value, id, which getId() fills in, or the lazy characteristicRelationship set) made * an updated characteristic miss that lookup, so Hibernate re-inserted its existing join-table row * and the update failed with a duplicate primary key. */ @Override public int hashCode() { return Objects.hash(id, name, valueType, characteristicRelationship, value, baseType, schemaLocation, type); return Objects.hash(name); } @Override Loading