Skip to content

Instantly share code, notes, and snippets.

@cosbor11
Created January 22, 2016 03:55
Show Gist options
  • Select an option

  • Save cosbor11/cf938cf8eda24c5d69de to your computer and use it in GitHub Desktop.

Select an option

Save cosbor11/cf938cf8eda24c5d69de to your computer and use it in GitHub Desktop.
Entity Definition of a Movie declaring a To Many relationship to actors
@Entity
public class Movie
{
@Identifier(generator = IdentifierGenerator.SEQUENCE)
@Attribute
protected long movieId;
@Attribute
protected String title;
@Relationship(type = RelationshipType.MANY_TO_MANY,
inverseClass = Actor.class,
inverse = "movies",
fetchPolicy = FetchPolicy.LAZY,
cascadePolicy = CascadePolicy.SAVE)
protected List<Actor> actors;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment