Spring Data Graph

org.springframework.data.graph.annotation
Annotation Type RelatedToVia


@Retention(value=RUNTIME)
@Target(value=FIELD)
public @interface RelatedToVia

Annotation for NodeEntity fields that relate to other entities via relationships. The fields represent read only iterators that provide the relationship-entities RelatedEntity of the relationships. The iterator reflects the underlying relationships.

 @RelatedToVia([type="roles"], elementClass=Role.class)
 Iterator<Role> roles;
 

Since:
27.08.2010
Author:
Michael Hunger

Required Element Summary
 String type
           
 
Optional Element Summary
 Direction direction
           
 Class<? extends RelationshipBacked> elementClass
           
 

Element Detail

type

public abstract String type
Returns:
name of the relationship type, optional, can be inferred from the field name

direction

public abstract Direction direction
Returns:
direction for the relationship, by default outgoing
Default:
org.springframework.data.graph.core.Direction.OUTGOING

elementClass

public abstract Class<? extends RelationshipBacked> elementClass
Returns:
target relationship entity class
Default:
org.springframework.data.graph.core.RelationshipBacked.class

Spring Data Graph

Copyright © 2011. All Rights Reserved.