diff --git a/src/main/java/org/openepics/names/repository/model/DeviceGroup.java b/src/main/java/org/openepics/names/repository/model/DeviceGroup.java index f18282156d0a8482d84828aee3a6d93220ccf17d..0fb5feb9ed6ad35cce14765ae62840b33b9fa5de 100644 --- a/src/main/java/org/openepics/names/repository/model/DeviceGroup.java +++ b/src/main/java/org/openepics/names/repository/model/DeviceGroup.java @@ -19,6 +19,7 @@ package org.openepics.names.repository.model; import java.util.Date; +import java.util.Objects; import java.util.UUID; import javax.persistence.Column; @@ -124,6 +125,17 @@ public class DeviceGroup extends Structure { return false; } + @Override + public int hashCode() { + return Objects.hash( + getId(), getVersion(), + getUuid(), getDescription(), getStatus(), isLatest(), isDeleted(), + getRequested(), getRequestedBy(), getRequestedComment(), + getProcessed(), getProcessedBy(), getProcessedComment(), + getName(), getMnemonic(), getMnemonicEquivalence(), + getParentUuid()); + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/src/main/java/org/openepics/names/repository/model/DeviceType.java b/src/main/java/org/openepics/names/repository/model/DeviceType.java index ece1a8a8270b3c6e93b4cabc2a6bdf9e358e6b32..8c58a263b0582c33f6e1a6c035e97bfa6307fbb1 100644 --- a/src/main/java/org/openepics/names/repository/model/DeviceType.java +++ b/src/main/java/org/openepics/names/repository/model/DeviceType.java @@ -19,6 +19,7 @@ package org.openepics.names.repository.model; import java.util.Date; +import java.util.Objects; import java.util.UUID; import javax.persistence.Column; @@ -124,6 +125,17 @@ public class DeviceType extends Structure { return false; } + @Override + public int hashCode() { + return Objects.hash( + getId(), getVersion(), + getUuid(), getDescription(), getStatus(), isLatest(), isDeleted(), + getRequested(), getRequestedBy(), getRequestedComment(), + getProcessed(), getProcessedBy(), getProcessedComment(), + getName(), getMnemonic(), getMnemonicEquivalence(), + getParentUuid()); + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/src/main/java/org/openepics/names/repository/model/Discipline.java b/src/main/java/org/openepics/names/repository/model/Discipline.java index be9ff32d944cec8bebf0208eec1c2c85c51a4456..106014352f4d6e51bde542b1eef594307c4d21bb 100644 --- a/src/main/java/org/openepics/names/repository/model/Discipline.java +++ b/src/main/java/org/openepics/names/repository/model/Discipline.java @@ -101,6 +101,11 @@ public class Discipline extends Structure { return false; } + @Override + public int hashCode() { + return super.hashCode(); + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/src/main/java/org/openepics/names/repository/model/Name.java b/src/main/java/org/openepics/names/repository/model/Name.java index 09be7a469cd8dbac5d29b667cea963ac9f3a2fac..32ed6c290458bbdd00331c976a9666513a04d54c 100644 --- a/src/main/java/org/openepics/names/repository/model/Name.java +++ b/src/main/java/org/openepics/names/repository/model/Name.java @@ -20,6 +20,7 @@ package org.openepics.names.repository.model; import java.io.Serializable; import java.util.Date; +import java.util.Objects; import java.util.UUID; import javax.persistence.Column; @@ -221,6 +222,17 @@ public class Name extends NameStructure implements Serializable { return false; } + @Override + public int hashCode() { + return Objects.hash( + getId(), getVersion(), + getUuid(), getDescription(), getStatus(), isLatest(), isDeleted(), + getRequested(), getRequestedBy(), getRequestedComment(), + getProcessed(), getProcessedBy(), getProcessedComment(), + getSystemgroupUuid(), getSystemUuid(), getSubsystemUuid(), getDevicetypeUuid(), getInstanceIndex(), + getConventionName(), getConventionNameEquivalence()); + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/src/main/java/org/openepics/names/repository/model/NameStructure.java b/src/main/java/org/openepics/names/repository/model/NameStructure.java index 1e143c33ad67ea12e00e3e46012470d36cf7beb8..c1c6a391f15df505b732baff946ce0180a4ec3f4 100644 --- a/src/main/java/org/openepics/names/repository/model/NameStructure.java +++ b/src/main/java/org/openepics/names/repository/model/NameStructure.java @@ -232,7 +232,11 @@ public class NameStructure extends Persistable implements Serializable { @Override public int hashCode() { - return Objects.hash(getUuid()); + return Objects.hash( + getId(), getVersion(), + getUuid(), getDescription(), getStatus(), isLatest(), isDeleted(), + getRequested(), getRequestedBy(), getRequestedComment(), + getProcessed(), getProcessedBy(), getProcessedComment()); } } diff --git a/src/main/java/org/openepics/names/repository/model/Persistable.java b/src/main/java/org/openepics/names/repository/model/Persistable.java index 99f23e636d2c6d735e0af861353ba4d574ace0f2..d10763ed7224cbc9050834d50e1756e0f0ab3bbb 100644 --- a/src/main/java/org/openepics/names/repository/model/Persistable.java +++ b/src/main/java/org/openepics/names/repository/model/Persistable.java @@ -21,6 +21,7 @@ package org.openepics.names.repository.model; import javax.annotation.Nullable; import javax.persistence.*; import java.io.Serializable; +import java.util.Objects; /** * A superclass implementing the properties required by JPA. It that should be extended by all classes that need to be @@ -85,4 +86,9 @@ public class Persistable implements Serializable { return true; } + @Override + public int hashCode() { + return Objects.hash(getId(), getVersion()); + } + } diff --git a/src/main/java/org/openepics/names/repository/model/Structure.java b/src/main/java/org/openepics/names/repository/model/Structure.java index 86003f2343930efbfdc88eebccd0b437454f175d..1d63b6b65c8671a8e328d24b65801c1c05b7fcd3 100644 --- a/src/main/java/org/openepics/names/repository/model/Structure.java +++ b/src/main/java/org/openepics/names/repository/model/Structure.java @@ -20,6 +20,7 @@ package org.openepics.names.repository.model; import java.io.Serializable; import java.util.Date; +import java.util.Objects; import java.util.UUID; import javax.persistence.Column; @@ -168,4 +169,14 @@ public class Structure extends NameStructure implements Serializable { return false; } + @Override + public int hashCode() { + return Objects.hash( + getId(), getVersion(), + getUuid(), getDescription(), getStatus(), isLatest(), isDeleted(), + getRequested(), getRequestedBy(), getRequestedComment(), + getProcessed(), getProcessedBy(), getProcessedComment(), + getName(), getMnemonic(), getMnemonicEquivalence()); + } + } diff --git a/src/main/java/org/openepics/names/repository/model/Subsystem.java b/src/main/java/org/openepics/names/repository/model/Subsystem.java index d34ac3825209814779aad30376e3cbbd9abe6c5b..f0d526a7472e298d25954bd2d45ca3c2acd15ba4 100644 --- a/src/main/java/org/openepics/names/repository/model/Subsystem.java +++ b/src/main/java/org/openepics/names/repository/model/Subsystem.java @@ -19,6 +19,7 @@ package org.openepics.names.repository.model; import java.util.Date; +import java.util.Objects; import java.util.UUID; import javax.persistence.Column; @@ -124,6 +125,17 @@ public class Subsystem extends Structure { return false; } + @Override + public int hashCode() { + return Objects.hash( + getId(), getVersion(), + getUuid(), getDescription(), getStatus(), isLatest(), isDeleted(), + getRequested(), getRequestedBy(), getRequestedComment(), + getProcessed(), getProcessedBy(), getProcessedComment(), + getName(), getMnemonic(), getMnemonicEquivalence(), + getParentUuid()); + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/src/main/java/org/openepics/names/repository/model/System.java b/src/main/java/org/openepics/names/repository/model/System.java index deb24e737bcf713e30ae60e0ee5fea44581b0468..b2296ac55e61110e20a686ffbd14861c439becf7 100644 --- a/src/main/java/org/openepics/names/repository/model/System.java +++ b/src/main/java/org/openepics/names/repository/model/System.java @@ -19,6 +19,7 @@ package org.openepics.names.repository.model; import java.util.Date; +import java.util.Objects; import java.util.UUID; import javax.persistence.Column; @@ -124,6 +125,17 @@ public class System extends Structure { return false; } + @Override + public int hashCode() { + return Objects.hash( + getId(), getVersion(), + getUuid(), getDescription(), getStatus(), isLatest(), isDeleted(), + getRequested(), getRequestedBy(), getRequestedComment(), + getProcessed(), getProcessedBy(), getProcessedComment(), + getName(), getMnemonic(), getMnemonicEquivalence(), + getParentUuid()); + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/src/main/java/org/openepics/names/repository/model/SystemGroup.java b/src/main/java/org/openepics/names/repository/model/SystemGroup.java index 3428d6442acf2ccbb7c3c832e2a53a85171aa624..4109cc03674c926d620f62bcce930fcc3cab4541 100644 --- a/src/main/java/org/openepics/names/repository/model/SystemGroup.java +++ b/src/main/java/org/openepics/names/repository/model/SystemGroup.java @@ -101,6 +101,11 @@ public class SystemGroup extends Structure { return false; } + @Override + public int hashCode() { + return super.hashCode(); + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/src/main/java/org/openepics/names/rest/beans/element/NameElement.java b/src/main/java/org/openepics/names/rest/beans/element/NameElement.java index ce04ff512f14833682fbe78da1c625549e97352c..b8fe73479dc718d526e5556f69ba2d0fadfd52f1 100644 --- a/src/main/java/org/openepics/names/rest/beans/element/NameElement.java +++ b/src/main/java/org/openepics/names/rest/beans/element/NameElement.java @@ -20,6 +20,7 @@ package org.openepics.names.rest.beans.element; import java.io.Serializable; import java.util.Date; +import java.util.Objects; import java.util.UUID; import org.openepics.names.rest.beans.Status; @@ -231,6 +232,16 @@ public class NameElement extends NameElementCommand implements Serializable { return true; } + @Override + public int hashCode() { + return Objects.hash( + getUuid(), getParentsystemstructure(), getParentdevicestructure(), getIndex(), + getDescription(), getComment(), + getSystemstructure(), getDevicestructure(), + getName(), getStatus(), isLatest(), isDeleted(), + getWhen(), getWho()); + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/src/main/java/org/openepics/names/rest/beans/element/NameElementCommand.java b/src/main/java/org/openepics/names/rest/beans/element/NameElementCommand.java index ece8e29f04ae5fe1e532ca398d49c785b77135c2..25f24abc166073648de1bec9c707270b87db6bb0 100644 --- a/src/main/java/org/openepics/names/rest/beans/element/NameElementCommand.java +++ b/src/main/java/org/openepics/names/rest/beans/element/NameElementCommand.java @@ -19,6 +19,7 @@ package org.openepics.names.rest.beans.element; import java.io.Serializable; +import java.util.Objects; import java.util.UUID; import io.swagger.v3.oas.annotations.media.Schema; @@ -172,6 +173,13 @@ public class NameElementCommand implements Serializable { return true; } + @Override + public int hashCode() { + return Objects.hash( + getUuid(), getParentsystemstructure(), getParentdevicestructure(), getIndex(), + getDescription(), getComment()); + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/src/main/java/org/openepics/names/rest/beans/element/StructureElement.java b/src/main/java/org/openepics/names/rest/beans/element/StructureElement.java index 06e084c3852e483781ea52a137e043a805b51d78..5f2dc7c18791d876a5ae65d00e0e97438943098a 100644 --- a/src/main/java/org/openepics/names/rest/beans/element/StructureElement.java +++ b/src/main/java/org/openepics/names/rest/beans/element/StructureElement.java @@ -20,6 +20,7 @@ package org.openepics.names.rest.beans.element; import java.io.Serializable; import java.util.Date; +import java.util.Objects; import java.util.UUID; import org.openepics.names.rest.beans.Status; @@ -220,6 +221,15 @@ public class StructureElement extends StructureElementCommand implements Seriali return true; } + @Override + public int hashCode() { + return Objects.hash( + getUuid(), getType(), getParent(), + getName(), getMnemonic(), getDescription(), getComment(), + getMnemonicpath(), getLevel(), getStatus(), isLatest(), isDeleted(), + getWhen(), getWho()); + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/src/main/java/org/openepics/names/rest/beans/element/StructureElementCommand.java b/src/main/java/org/openepics/names/rest/beans/element/StructureElementCommand.java index 18a087afd5d8bcfc698965323b291fd8c5610ed8..67a9cb315a6e3081a3aca05acc36e0f2ad1b120f 100644 --- a/src/main/java/org/openepics/names/rest/beans/element/StructureElementCommand.java +++ b/src/main/java/org/openepics/names/rest/beans/element/StructureElementCommand.java @@ -19,6 +19,7 @@ package org.openepics.names.rest.beans.element; import java.io.Serializable; +import java.util.Objects; import java.util.UUID; import org.openepics.names.rest.beans.Type; @@ -186,6 +187,13 @@ public class StructureElementCommand implements Serializable { return true; } + @Override + public int hashCode() { + return Objects.hash( + getUuid(), getType(), getParent(), + getName(), getMnemonic(), getDescription(), getComment()); + } + @Override public String toString() { StringBuilder sb = new StringBuilder();