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.
This commit is contained in:
committed by
Oliver Drotbohm
parent
e2b9de4fbb
commit
3da54402c2
@@ -20,6 +20,8 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.data.annotation.PersistenceConstructor;
|
||||
import org.springframework.data.neo4j.core.schema.GeneratedValue;
|
||||
import org.springframework.data.neo4j.core.schema.Id;
|
||||
import org.springframework.data.neo4j.core.schema.RelationshipProperties;
|
||||
import org.springframework.data.neo4j.core.schema.TargetNode;
|
||||
|
||||
@@ -32,6 +34,10 @@ import org.springframework.data.neo4j.core.schema.TargetNode;
|
||||
@RelationshipProperties
|
||||
public class Roles {
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
private Long id;
|
||||
|
||||
private final List<String> roles;
|
||||
|
||||
@TargetNode
|
||||
|
||||
Reference in New Issue
Block a user