You would use @RelatedToVia
instead and use a @RelationshipEntity
as component type of your set (or your single field type).
@RelationshipEntity(type="TEAMMATE")
class Collaboration {
@StartNode Person p1;
@EndNode Person p2;
Date start;
Date end;
}
@RelatedToVia(type="TEAMMATE", direction=Direction.BOTH)
public Set<Collaboration> teammates;
See also the documentation at: http://docs.spring.io/spring-data/data-neo4j/docs/3.1.0.RC1/reference/htmlsingle/#d0e1915