diff --git a/build.gradle b/build.gradle index fee02383..df0e55de 100644 --- a/build.gradle +++ b/build.gradle @@ -40,7 +40,7 @@ dependencies { implementation "cz.cvut.kbss.jopa:jopa-impl:$jopaVersion" implementation "cz.cvut.kbss.jopa:ontodriver-rdf4j:$jopaVersion" implementation 'cz.cvut.kbss.jsonld:jb4jsonld-jackson:0.13.2' - implementation 'com.github.ledsoft:jopa-spring-transaction:0.2.0' + implementation 'com.github.ledsoft:jopa-spring-transaction:0.3.0-SNAPSHOT' implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'org.springframework.boot:spring-boot-starter-security' diff --git a/src/main/java/cz/cvut/kbss/analysis/dto/UserUpdateDTO.java b/src/main/java/cz/cvut/kbss/analysis/dto/UserUpdateDTO.java index c482ce70..a915bc0c 100755 --- a/src/main/java/cz/cvut/kbss/analysis/dto/UserUpdateDTO.java +++ b/src/main/java/cz/cvut/kbss/analysis/dto/UserUpdateDTO.java @@ -1,11 +1,11 @@ package cz.cvut.kbss.analysis.dto; import cz.cvut.kbss.analysis.model.User; -import lombok.Data; -import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; -@EqualsAndHashCode(callSuper = true) -@Data +@Getter +@Setter public class UserUpdateDTO extends User { private String newPassword; diff --git a/src/main/java/cz/cvut/kbss/analysis/model/AbstractEntity.java b/src/main/java/cz/cvut/kbss/analysis/model/AbstractEntity.java index 845760dc..f334e0e2 100755 --- a/src/main/java/cz/cvut/kbss/analysis/model/AbstractEntity.java +++ b/src/main/java/cz/cvut/kbss/analysis/model/AbstractEntity.java @@ -22,14 +22,15 @@ public abstract class AbstractEntity implements HasIdentifier, Serializable { @Override public boolean equals(Object o) { if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if(! (o instanceof AbstractEntity)) + return false; AbstractEntity that = (AbstractEntity) o; return Objects.equals(uri, that.uri); } @Override public int hashCode() { - return Objects.hash(uri); + return Objects.hash(uri.toString()); } @Override diff --git a/src/main/java/cz/cvut/kbss/analysis/model/Component.java b/src/main/java/cz/cvut/kbss/analysis/model/Component.java index f24e2579..40949437 100755 --- a/src/main/java/cz/cvut/kbss/analysis/model/Component.java +++ b/src/main/java/cz/cvut/kbss/analysis/model/Component.java @@ -39,18 +39,4 @@ public void addFailureMode(FailureMode failureMode) { public String toString() { return "Component <" + getUri() + "/>"; } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - if (!super.equals(o)) return false; - Component that = (Component) o; - return getUri().equals(that.getUri()); - } - - @Override - public int hashCode() { - return Objects.hash(getUri()); - } } diff --git a/src/main/java/cz/cvut/kbss/analysis/model/FailureMode.java b/src/main/java/cz/cvut/kbss/analysis/model/FailureMode.java index 516cadc0..ebbf2656 100755 --- a/src/main/java/cz/cvut/kbss/analysis/model/FailureMode.java +++ b/src/main/java/cz/cvut/kbss/analysis/model/FailureMode.java @@ -19,18 +19,4 @@ public class FailureMode extends Behavior { public String toString() { return "FailureMode <" + getUri() + "/>"; } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - FailureMode that = (FailureMode) o; - return Objects.equals(getUri(), that.getUri()); - } - - @Override - public int hashCode() { - return Objects.hash(getUri()); - } - } diff --git a/src/main/java/cz/cvut/kbss/analysis/model/FailureModesRow.java b/src/main/java/cz/cvut/kbss/analysis/model/FailureModesRow.java index 7298bafb..fb60cec3 100755 --- a/src/main/java/cz/cvut/kbss/analysis/model/FailureModesRow.java +++ b/src/main/java/cz/cvut/kbss/analysis/model/FailureModesRow.java @@ -50,18 +50,4 @@ public FailureModesRow(FailureModesRow failureModesRow) { public String toString() { return "FailureModesRow <" + getUri() + "/>"; } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - FailureModesRow that = (FailureModesRow) o; - return Objects.equals(getUri(), that.getUri()) && Objects.equals(localEffect, that.getLocalEffect()); - } - - @Override - public int hashCode() { - return Objects.hash(getUri()); - } - } diff --git a/src/main/java/cz/cvut/kbss/analysis/model/FailureModesTable.java b/src/main/java/cz/cvut/kbss/analysis/model/FailureModesTable.java index fe90a4ba..2c5f3c06 100755 --- a/src/main/java/cz/cvut/kbss/analysis/model/FailureModesTable.java +++ b/src/main/java/cz/cvut/kbss/analysis/model/FailureModesTable.java @@ -27,18 +27,4 @@ public class FailureModesTable extends NamedEntity { public String toString() { return "FailureModesTable <" + getUri() + "/>"; } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - FailureModesTable that = (FailureModesTable) o; - return Objects.equals(getUri(), that.getUri()); - } - - @Override - public int hashCode() { - return Objects.hash(getUri()); - } - } diff --git a/src/main/java/cz/cvut/kbss/analysis/model/FaultEvent.java b/src/main/java/cz/cvut/kbss/analysis/model/FaultEvent.java index 8dc18c30..a2768610 100755 --- a/src/main/java/cz/cvut/kbss/analysis/model/FaultEvent.java +++ b/src/main/java/cz/cvut/kbss/analysis/model/FaultEvent.java @@ -83,18 +83,4 @@ public void addChild(FaultEvent child) { public String toString() { return "FaultEvent <" + getUri() + "/>"; } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - if (!super.equals(o)) return false; - FaultEvent that = (FaultEvent) o; - return getUri().equals(that.getUri()); - } - - @Override - public int hashCode() { - return Objects.hash(getUri()); - } } diff --git a/src/main/java/cz/cvut/kbss/analysis/model/Function.java b/src/main/java/cz/cvut/kbss/analysis/model/Function.java index 890ee033..9fba4008 100755 --- a/src/main/java/cz/cvut/kbss/analysis/model/Function.java +++ b/src/main/java/cz/cvut/kbss/analysis/model/Function.java @@ -17,18 +17,6 @@ public String toString() { return "Function <" + getUri() + "/>"; } - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - Function that = (Function) o; - return Objects.equals(getUri(), that.getUri()); - } - - @Override - public int hashCode() { - return Objects.hash(getUri()); - } } diff --git a/src/main/java/cz/cvut/kbss/analysis/model/Mitigation.java b/src/main/java/cz/cvut/kbss/analysis/model/Mitigation.java index 2f4c1c0d..c616cc95 100755 --- a/src/main/java/cz/cvut/kbss/analysis/model/Mitigation.java +++ b/src/main/java/cz/cvut/kbss/analysis/model/Mitigation.java @@ -21,18 +21,4 @@ public class Mitigation extends Behavior { public String toString() { return "Mitigation <" + getUri() + "/>"; } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - Mitigation that = (Mitigation) o; - return Objects.equals(getUri(), that.getUri()); - } - - @Override - public int hashCode() { - return Objects.hash(getUri()); - } - } diff --git a/src/main/java/cz/cvut/kbss/analysis/model/RiskPriorityNumber.java b/src/main/java/cz/cvut/kbss/analysis/model/RiskPriorityNumber.java index a5c97e0e..d09537af 100755 --- a/src/main/java/cz/cvut/kbss/analysis/model/RiskPriorityNumber.java +++ b/src/main/java/cz/cvut/kbss/analysis/model/RiskPriorityNumber.java @@ -38,18 +38,4 @@ public class RiskPriorityNumber extends AbstractEntity { public String toString() { return "RiskPriorityNumber <" + getUri() + "/>"; } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - RiskPriorityNumber that = (RiskPriorityNumber) o; - return Objects.equals(getUri(), that.getUri()); - } - - @Override - public int hashCode() { - return Objects.hash(getUri()); - } - } diff --git a/src/main/java/cz/cvut/kbss/analysis/model/System.java b/src/main/java/cz/cvut/kbss/analysis/model/System.java index d3eb7cc8..10ac4cb7 100755 --- a/src/main/java/cz/cvut/kbss/analysis/model/System.java +++ b/src/main/java/cz/cvut/kbss/analysis/model/System.java @@ -29,19 +29,4 @@ public void addComponent(Component component) { public String toString() { return "System <" + getUri() + "/>"; } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - if (!super.equals(o)) return false; - System that = (System) o; - return getUri().equals(that.getUri()); - } - - @Override - public int hashCode() { - return Objects.hash(getUri()); - } - } diff --git a/src/main/java/cz/cvut/kbss/analysis/model/User.java b/src/main/java/cz/cvut/kbss/analysis/model/User.java index 962a2aa1..8278335c 100755 --- a/src/main/java/cz/cvut/kbss/analysis/model/User.java +++ b/src/main/java/cz/cvut/kbss/analysis/model/User.java @@ -64,18 +64,4 @@ public boolean isEnabled() { public String toString() { return "User <" + getUri() + "/>"; } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - User that = (User) o; - return Objects.equals(getUri(), that.getUri()); - } - - @Override - public int hashCode() { - return Objects.hash(getUri()); - } - }