X-Git-Url: https://gerrit.onap.org/r/gitweb?p=portal.git;a=blobdiff_plain;f=portal-BE%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fportal%2Fdomain%2Fdto%2FDomainVo.java;h=6901aeeffe96d14eb709257f7cab30978b9a399c;hp=e14b93722d39aa9b78627550cf7322eb6523d6c1;hb=f51a049146c96181b43ca3f72c1cf715f07d24a9;hpb=2eaf7baff879929156699033bf62d29c0fd0040f diff --git a/portal-BE/src/main/java/org/onap/portal/domain/dto/DomainVo.java b/portal-BE/src/main/java/org/onap/portal/domain/dto/DomainVo.java index e14b9372..6901aeef 100644 --- a/portal-BE/src/main/java/org/onap/portal/domain/dto/DomainVo.java +++ b/portal-BE/src/main/java/org/onap/portal/domain/dto/DomainVo.java @@ -45,7 +45,7 @@ import java.io.ByteArrayOutputStream; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Serializable; -import java.util.Date; +import java.time.LocalDateTime; import java.util.Set; import javax.persistence.Inheritance; import javax.persistence.InheritanceType; @@ -60,12 +60,14 @@ import org.onap.portalsdk.core.domain.FusionVo; @Setter @NoArgsConstructor @AllArgsConstructor -@Inheritance(strategy = InheritanceType.JOINED) +@Inheritance(strategy = InheritanceType.SINGLE_TABLE) public class DomainVo extends FusionVo implements Serializable, Cloneable, Comparable { + private static final long serialVersionUID = 1L; + protected Long id; - protected Date created; - protected Date modified; + protected LocalDateTime created; + protected LocalDateTime modified; protected FnUser createdId; protected FnUser modifiedId; protected Long rowNum; @@ -75,7 +77,7 @@ public class DomainVo extends FusionVo implements Serializable, Cloneable, Compa @Override public int compareTo(Object obj) { Long c1 = this.getId(); - Long c2 = ((org.onap.portalsdk.core.domain.support.DomainVo)obj).getId(); + Long c2 = ((org.onap.portalsdk.core.domain.support.DomainVo) obj).getId(); return c1 != null && c2 != null ? c1.compareTo(c2) : 1; } @@ -92,7 +94,7 @@ public class DomainVo extends FusionVo implements Serializable, Cloneable, Compa oos.writeObject(this); bais = new ByteArrayInputStream(baos.toByteArray()); ois = new ObjectInputStream(bais); - newVo = (DomainVo)ois.readObject(); + newVo = (DomainVo) ois.readObject(); if (isIdNull) { newVo.setId(null); } @@ -106,4 +108,22 @@ public class DomainVo extends FusionVo implements Serializable, Cloneable, Compa public Object clone() throws CloneNotSupportedException { return super.clone(); } + + public boolean equals(Object other) { + if (this == other) { + return true; + } else if (other == null) { + return false; + } else if (!(other instanceof DomainVo)) { + return false; + } else { + DomainVo castOther = (DomainVo)other; + return this.getId().equals(castOther.getId()) + && this.getCreated().equals(castOther.getCreated()) + && this.getCreatedId().equals(castOther.getCreatedId()) + && this.getModified().equals(castOther.getModified()) + && this.getModifiedId() == castOther.getModifiedId(); + } + } + }