Skip to content

Commit 1e06511

Browse files
committed
Update Neo4j example.
Spring Data Neo4j 6.1 will enforce the usage of an identifier in relationship properties. Otherwise unmapped properties of relationships could get overwritten.
1 parent 9ff2a28 commit 1e06511

File tree

1 file changed

+6
-0
lines changed
  • neo4j/example/src/main/java/example/springdata/neo4j

1 file changed

+6
-0
lines changed

neo4j/example/src/main/java/example/springdata/neo4j/Roles.java

+6
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
import java.util.List;
2121

2222
import org.springframework.data.annotation.PersistenceConstructor;
23+
import org.springframework.data.neo4j.core.schema.GeneratedValue;
24+
import org.springframework.data.neo4j.core.schema.Id;
2325
import org.springframework.data.neo4j.core.schema.RelationshipProperties;
2426
import org.springframework.data.neo4j.core.schema.TargetNode;
2527

@@ -32,6 +34,10 @@
3234
@RelationshipProperties
3335
public class Roles {
3436

37+
@Id
38+
@GeneratedValue
39+
private Long id;
40+
3541
private final List<String> roles;
3642

3743
@TargetNode

0 commit comments

Comments
 (0)