summaryrefslogtreecommitdiffstats
path: root/cps-ri/src/main
diff options
context:
space:
mode:
authorToine Siebelink <toine.siebelink@est.tech>2023-05-04 14:14:08 +0000
committerGerrit Code Review <gerrit@onap.org>2023-05-04 14:14:08 +0000
commit61e8551cf91c95844963f0e52cefddb6a7477d38 (patch)
tree246f44c62887b5d413d6fbd7a22c6c12a5fd35c6 /cps-ri/src/main
parentd3a2b33cf99e1ae334c0690e7f5dc1a299f39fb7 (diff)
parentd701ea2c8a9d437846a3c08c103c8b68eaff7334 (diff)
Merge "Sensible equals and hashCode for FragmentEntity (CPS-1664 #1)"
Diffstat (limited to 'cps-ri/src/main')
-rw-r--r--cps-ri/src/main/java/org/onap/cps/spi/entities/AnchorEntity.java5
-rw-r--r--cps-ri/src/main/java/org/onap/cps/spi/entities/DataspaceEntity.java5
-rwxr-xr-xcps-ri/src/main/java/org/onap/cps/spi/entities/FragmentEntity.java1
3 files changed, 10 insertions, 1 deletions
diff --git a/cps-ri/src/main/java/org/onap/cps/spi/entities/AnchorEntity.java b/cps-ri/src/main/java/org/onap/cps/spi/entities/AnchorEntity.java
index b893428278..b59150f2e4 100644
--- a/cps-ri/src/main/java/org/onap/cps/spi/entities/AnchorEntity.java
+++ b/cps-ri/src/main/java/org/onap/cps/spi/entities/AnchorEntity.java
@@ -1,6 +1,7 @@
/*
* ============LICENSE_START=======================================================
* Copyright (C) 2021 Pantheon.tech
+ * Modifications Copyright (C) 2023 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,6 +33,7 @@ import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Builder;
+import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@@ -46,6 +48,7 @@ import lombok.Setter;
@Builder
@Entity
@Table(name = "anchor")
+@EqualsAndHashCode(onlyExplicitlyIncluded = true)
public class AnchorEntity implements Serializable {
private static final long serialVersionUID = -8049987915308262518L;
@@ -56,6 +59,7 @@ public class AnchorEntity implements Serializable {
@NotNull
@Column
+ @EqualsAndHashCode.Include
private String name;
@NotNull
@@ -66,5 +70,6 @@ public class AnchorEntity implements Serializable {
@NotNull
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "dataspace_id")
+ @EqualsAndHashCode.Include
private DataspaceEntity dataspace;
}
diff --git a/cps-ri/src/main/java/org/onap/cps/spi/entities/DataspaceEntity.java b/cps-ri/src/main/java/org/onap/cps/spi/entities/DataspaceEntity.java
index 593746d94f..4d97054d9e 100644
--- a/cps-ri/src/main/java/org/onap/cps/spi/entities/DataspaceEntity.java
+++ b/cps-ri/src/main/java/org/onap/cps/spi/entities/DataspaceEntity.java
@@ -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;
/**
diff --git a/cps-ri/src/main/java/org/onap/cps/spi/entities/FragmentEntity.java b/cps-ri/src/main/java/org/onap/cps/spi/entities/FragmentEntity.java
index 05befc8711..e696a4064a 100755
--- a/cps-ri/src/main/java/org/onap/cps/spi/entities/FragmentEntity.java
+++ b/cps-ri/src/main/java/org/onap/cps/spi/entities/FragmentEntity.java
@@ -88,6 +88,7 @@ public class FragmentEntity implements Serializable {
@OneToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "anchor_id")
+ @EqualsAndHashCode.Include
private AnchorEntity anchor;
@ToString.Exclude