/** * A Role relationship entity between an actor and movie. * * @author Luanne Misquitta * @author Michael J. Simons */ @RelationshipEntity(type = "ACTED_IN") @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) @Getter public class Role { private @Id @GeneratedValue Long id; private @StartNode Actor actor; private String role; private @EndNode Movie movie; Role(Actor actor, String role, Movie movie) { this.actor = actor; this.role = role; this.movie = movie; } }
/** * @author Frantisek Hartman */ @RelationshipEntity(type = "ASSOCIATED_WITH") public class Associated { private Long id; @StartNode Entity start; @EndNode Entity end; }
/** * @author Frantisek Hartman */ @RelationshipEntity(type = "FOUNDED") public class Founded { Long id; @StartNode Person person; @EndNode Entity organisation; }
@RelationshipEntity(type = "Arc") public static class Arc { Long id; Long created; @StartNode Vertex from; @EndNode Vertex to; } }
/** * @author vince */ @RelationshipEntity(type = "KNOWS") public class Knows { Long id; @StartNode Entity knower; @EndNode Entity knowee; }
@RelationshipEntity(type = "abstractDynamicProperty") public abstract class L<T> { Long id; private T property; @StartNode public SomeNode a; @EndNode public SomeOtherNode b; }
/** * @author Frantisek Hartman */ @RelationshipEntity(type = "ASSOCIATED_WITH") public class Associated<S extends Entity, T extends Entity> { private Long id; @StartNode S start; @EndNode T end; }
@RelationshipEntity(type = "GENERIC") public class GenericRelationship<S extends EntitySuperInterface, T extends EntitySuperInterface> { private Long id; @StartNode public S source; @EndNode public T target; }
/** * @author Frantisek Hartman */ @RelationshipEntity(type = "FOUNDED") public class Founded { Long id; @StartNode Person person; @EndNode Organisation organisation; }
/** * Relationship entity which is not referred from node entities * @author Frantisek Hartman */ @RelationshipEntity(type = "VISITED") public class Visited { Long id; @StartNode Person person; @EndNode Location location; Date when; }
/** * @author Nils Dr\u00F6ge */ @RelationshipEntity(type = "RELATED_TO") public class RichRelation { @StartNode public Person person; @EndNode public Article article; Long id; public RichRelation() { } }
@RelationshipEntity(type = "EDGE") public static class R { Long id; @StartNode A a; @EndNode B b; int number; @Override public String toString() { return this.getClass().getSimpleName() + ":" + a.id + "->" + b.id; } }
@RelationshipEntity(type = "EDGE") public static class R { Long id; @StartNode A a; @EndNode B b; int number; @Override public String toString() { return this.getClass().getSimpleName() + ":" + a.id + "->" + b.id; } } }
@RelationshipEntity(type = "EDGE") public static class R { Long id; String comments; Integer stars; @StartNode U u; @EndNode M m; public R() { } public R(U u, M m, String comments, Integer stars) { this.u = u; this.m = m; this.comments = comments; this.stars = stars; } }
/** * @author Vince Bickers */ @RelationshipEntity(type = "ACTS_IN") public class Role { Long id; String played; @StartNode Actor actor; @EndNode Movie movie; public Role() { } public Role(String character, Actor actor, Movie movie) { played = character; this.actor = actor; this.movie = movie; } }
@RelationshipEntity(type = "LIKES") static class Likes { Long id; @Id String uuid; @StartNode User from; @EndNode User to; int stars; } }
/** * @author Frantisek Hartman */ @RelationshipEntity(type = "REL") public class RelPropertyExistenceConstraintEntity { Long id; @StartNode Entity start; @EndNode Entity end; @Required String description; }
public abstract class BaseEdge<T extends BaseNode, U extends BaseNode> { @Id @GeneratedValue public Long relationshipId; public String title; @StartNode public T start; @EndNode public U end; public BaseEdge() { } public BaseEdge(T start, U end, String title) { this.start = start; this.end = end; this.title = title; } }
@RelationshipEntity("PLAYS") public class Plays { @Id @GeneratedValue private Long id; @StartNode private User user; @EndNode private Hobby hobby; private String level; }
/** * This is a relationship entity only to test navigation in one direction. Do not make this a node entity. * * @author Luanne Misquitta */ @RelationshipEntity(type = "COMMENT_BY") public class Comment { @Id @GeneratedValue Long id; @StartNode Post post; @EndNode Author author; String comment; public Comment() { } public Comment(Post post, Author author, String comment) { this.post = post; this.author = author; this.comment = comment; } }