Skip to content

Commit

Permalink
Merge pull request #63 from kbss-cvut/fix/62-fix-jopa-dependencies-an…
Browse files Browse the repository at this point in the history
…d-model

Fix/62 fix jopa dependencies and model
  • Loading branch information
kostobog authored Feb 12, 2024
2 parents 22b24d3 + 24adce6 commit 54433c3
Show file tree
Hide file tree
Showing 13 changed files with 8 additions and 146 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/cz/cvut/kbss/analysis/dto/UserUpdateDTO.java
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
5 changes: 3 additions & 2 deletions src/main/java/cz/cvut/kbss/analysis/model/AbstractEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 0 additions & 14 deletions src/main/java/cz/cvut/kbss/analysis/model/Component.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
14 changes: 0 additions & 14 deletions src/main/java/cz/cvut/kbss/analysis/model/FailureMode.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

}
14 changes: 0 additions & 14 deletions src/main/java/cz/cvut/kbss/analysis/model/FailureModesRow.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

}
14 changes: 0 additions & 14 deletions src/main/java/cz/cvut/kbss/analysis/model/FailureModesTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

}
14 changes: 0 additions & 14 deletions src/main/java/cz/cvut/kbss/analysis/model/FaultEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
12 changes: 0 additions & 12 deletions src/main/java/cz/cvut/kbss/analysis/model/Function.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

}

14 changes: 0 additions & 14 deletions src/main/java/cz/cvut/kbss/analysis/model/Mitigation.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

}
14 changes: 0 additions & 14 deletions src/main/java/cz/cvut/kbss/analysis/model/RiskPriorityNumber.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

}
15 changes: 0 additions & 15 deletions src/main/java/cz/cvut/kbss/analysis/model/System.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

}
14 changes: 0 additions & 14 deletions src/main/java/cz/cvut/kbss/analysis/model/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

}

0 comments on commit 54433c3

Please sign in to comment.