private Long id; @Relationship(type = "CONTAINS_PRODUCT") private Set<Inventory> inventories = new HashSet<>(); @Relationship(type = "SHIP_TO") private Address deliveryAddress; @Relationship(type = "SHIP_FROM") private Warehouse fromWarehouse;
/** * A Movie node entity. * * @author Luanne Misquitta * @author Oliver Gierke * @author Michael J. Simons */ @NodeEntity(label = "Movie") @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) @Getter public class Movie { private @Id @GeneratedValue Long id; private String title; private @Relationship(type = "ACTED_IN", direction = "INCOMING") Set<Role> roles = new HashSet<>(); public Movie(String title) { this.title = title; } }
/** * An Actor node entity. * * @author Luanne Misquitta * @author Oliver Gierke * @author Michael J. Simons */ @NodeEntity(label = "Actor") @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) @Getter public class Actor { private @Id @GeneratedValue Long id; private String name; private @Relationship(type = "ACTED_IN") Set<Role> roles = new HashSet<>(); public Actor(String name) { this.name = name; } public void actedIn(Movie movie, String roleName) { Role role = new Role(this, roleName, movie); roles.add(role); movie.getRoles().add(role); } }
@Relationship(type = "PRODUCT_TYPE", direction = "OUTGOING") private Product product; @Relationship(type = "STOCKED_IN", direction = "OUTGOING") private Warehouse warehouse;
@Relationship(type="HAS_ADDRESS") private Address address;
@Relationship(type = "HAS_PRODUCT", direction = "OUTGOING") private List<Product> products = new ArrayList<>();
public static class Start { Long id; String name; @Relationship(type = "REL_ENTITY_TYPE", direction = "OUTGOING") Set<RelEntity> relEntities; public Start() { } }
/** * @author Nils Dr\u00F6ge */ public class Article extends Entity { @Relationship(type = "RELATED_TO", direction = "INCOMING") public Set<RichRelation> relations = new HashSet<>(); @Relationship(type = "HAS") public List<Tag> tags; }
public class SourceEntityWithEntitySuperInterface implements EntitySuperInterface { private Long id; @Relationship(type = "GENERIC") public GenericRelationship<SourceEntityWithEntitySuperInterface, ? extends EntitySuperInterface> relationship; }
static class End { Long id; String name; @Relationship(type = "REL_ENTITY_TYPE", direction = "INCOMING") Set<RelEntity> relEntities = new HashSet<>(); End() { } Set<RelEntity> getRelEntities() { return relEntities; } } }
/** * @author Luanne Misquitta */ public class TagEntity { Long id; @Relationship(type = "TAGGED_WITH") Set<TagModel> tags; }
public static class Start { Long id; String name; @Relationship(type = "REL_ENTITY_TYPE", direction = "OUTGOING") Set<RelEntity> relEntities; public Start() { } }
public class Mortal { private Long id; private String name; @Relationship(type = "KNOWN_BY", direction = "INCOMING") private Set<Mortal> knownBy; }
public static class Start { Long id; String name; @Relationship(type = "REL_ENTITY_TYPE", direction = "OUTGOING") Set<RelEntity> relEntities; public Start() { } }
/** * Field annotated with incoming relationship. No methods present. * * @author Luanne Misquitta */ public class UserV17 extends Entity { @Relationship(type = "KNOWS", direction = "INCOMING") public UserV17 knows; }
/** * Iterable field annotated with incoming relationship. No methods present. * * @author Luanne Misquitta */ public class UserV17 extends Entity { @Relationship(type = "KNOWS", direction = "INCOMING") public Set<UserV17> knows; }
public static class End { Long id; String name; @Relationship(type = "REL_ENTITY_TYPE", direction = "INCOMING") Set<RelEntity> relEntities; public End() { } public Set<RelEntity> getRelEntities() { return relEntities; } } }
/** * @author Frantisek Hartman */ @NodeEntity public class Restaurant { Long id; @Relationship(type = "SIMILAR_TO") Set<Restaurant> similarTo; }
/** * @author Frantisek Hartman */ @NodeEntity public class Organisation extends Entity { @Relationship(type = "ASSOCIATED_WITH") Set<Associated> associations; }
@NodeEntity public final class SomeNode<T> { Long id; @Relationship private List<L<T>> listOfLs; }