Sensible equals and hashCode for FragmentEntity (CPS-1664 #1)
[cps.git] / cps-ri / src / main / java / org / onap / cps / spi / entities / DataspaceEntity.java
index 593746d..4d97054 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  ============LICENSE_START=======================================================
- *  Copyright (C) 2020-2021 Nordix Foundation.
+ *  Copyright (C) 2020-2023 Nordix Foundation.
  *  Modifications Copyright (C) 2020-2021 Pantheon.tech
  *  ================================================================================
  *  Licensed under the Apache License, Version 2.0 (the "License");
@@ -30,6 +30,7 @@ import javax.persistence.Id;
 import javax.persistence.Table;
 import javax.validation.constraints.NotNull;
 import lombok.AllArgsConstructor;
+import lombok.EqualsAndHashCode;
 import lombok.Getter;
 import lombok.NoArgsConstructor;
 import lombok.Setter;
@@ -44,6 +45,7 @@ import lombok.Setter;
 @AllArgsConstructor
 @NoArgsConstructor
 @Table(name = "dataspace")
+@EqualsAndHashCode(onlyExplicitlyIncluded = true)
 public class DataspaceEntity implements Serializable {
 
     private static final long serialVersionUID = 8395254649813051882L;
@@ -54,6 +56,7 @@ public class DataspaceEntity implements Serializable {
 
     @NotNull
     @Column(columnDefinition = "text")
+    @EqualsAndHashCode.Include
     private String name;
 
     /**