/** * 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); } }
@NodeEntity public class Address {
@NodeEntity public class Warehouse {
@NodeEntity public class Catalog {
@NodeEntity public class Product {
@NodeEntity public class Inventory {
@NodeEntity public class Shipment {
/** * @author Nicolas Mervaillie */ @NodeEntity public class ExtendedUser extends User { public ExtendedUser() { } public ExtendedUser(String login, String name, String password) { super(login, name, password); } }
/** * @author Michal Bachman */ @NodeEntity(label = "Parent") public abstract class AnnotatedAbstractNamedParent { private Long id; }
/** * @author Michal Bachman */ @NodeEntity(label = "Child") public class AnnotatedNamedChildWithPlainAbstractParent extends PlainAbstractParent { }
/** * @author Frantisek Hartman */ @NodeEntity public class PowerUser extends User { public PowerUser() { } public PowerUser(String name) { super(name); } }
/** * @author Michal Bachman */ @NodeEntity public class AnnotatedChildWithAnnotatedAbstractNamedParent extends AnnotatedAbstractNamedParent { }
/** * @author Luanne Misquitta */ @NodeEntity(label = "Child") public class AnnotatedNamedChildWithAnnotatedNamedInterfaceParent implements AnnotatedNamedInterfaceParent { Long id; }
/** * @author Frantisek Hartman */ @NodeEntity(label = "Entity") public class Entity { Long id; }
/** * @author vince */ @NodeEntity(label = "Movie") public class Movie extends Entity { @Relationship(type = "RATED", direction = Relationship.INCOMING) public List<Rating> ratings = new ArrayList<>(); }
/** * @author Frantisek Hartman */ @NodeEntity(label = "Entity") @CompositeIndex public class NoPropertyCompositeIndexEntity { Long id; String name; int age; }
/** * @author Michael J. Simons */ @NodeEntity public abstract class LabeledEntity { @Id protected String uuid; }
/** * @author Frantisek Hartman */ @NodeEntity(label = "Entity") public class NodePropertyExistenceConstraintEntity { Long id; @Required String login; }
@NodeEntity("C") public static class C { @Id @GeneratedValue private Long id; private String name; }