Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,6 @@ public class Person implements RelationIdentity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

@Override
public String getType() {
return "PersonType";
}
}
```

Expand Down Expand Up @@ -121,7 +116,7 @@ public class DisabledRelationEntity {

## <a name="RelationIdentity"></a> Implement RelationIdentity

Implement the relationIdentity, each dynamic relation need a Long id and a String Type which you can define.
Implement the relationIdentity, each dynamic relation need a Long id which you can define.

```java

Expand All @@ -134,11 +129,6 @@ public class Person implements RelationIdentity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

@Override
public String getType() {
return "PersonType";
}
}

```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ public interface RelationIdentity {

Long getId();

String getType();

/**
* Returns the type of the relation identity.
* This is used to identify the type of the relation in a generic way.
*
* @return the type of the relation identity
*/
default String getType() {
return this.getClass().getSimpleName() + "Type";
}
}
5 changes: 0 additions & 5 deletions testing/src/main/java/at/test/drm/AnnotationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,4 @@ public class AnnotationTest implements RelationIdentity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

@Override
public String getType() {
return "TestType";
}
}
5 changes: 0 additions & 5 deletions testing/src/main/java/at/test/drm/AnnotationTest2.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,4 @@ public class AnnotationTest2 implements RelationIdentity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

@Override
public String getType() {
return "AnnotationType2";
}
}
5 changes: 0 additions & 5 deletions testing/src/main/java/at/test/drm/AnnotationTest3.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,4 @@ public class AnnotationTest3 implements RelationIdentity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

@Override
public String getType() {
return "AnnotationType3";
}
}