Module spring.data.neo4j
Annotation Interface RelationshipProperties
@Retention(RUNTIME)
@Target(TYPE)
@Documented
@Inherited
@API(status=STABLE,
since="6.0")
public @interface RelationshipProperties
This marker interface is used on classes to mark that they represent additional relationship properties. A class that
implements this interface must not be used as a or annotated with
Node. It must however have exactly one field
of type `Long` annotated with `@Id @GeneratedValue` such as this:
@RelationshipProperties
public class Roles {
@Id @GeneratedValue
private Long id;
@TargetNode
private final Person person;
// Your properties
}
- Author:
- Gerrit Meier, Michael J. Simons
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionbooleanSet to true will persistConstants.NAME_OF_RELATIONSHIP_TYPEtoClass.getSimpleName()as a property in relationships.
-
Element Details
-
persistTypeInfo
boolean persistTypeInfoSet to true will persistConstants.NAME_OF_RELATIONSHIP_TYPEtoClass.getSimpleName()as a property in relationships. This property will be used to determine the type of the relationship when mapping back to the domain model.- Returns:
- whether to persist type information for the annotated class.
- Default:
- false
-