Created
January 22, 2016 03:55
-
-
Save cosbor11/cf938cf8eda24c5d69de to your computer and use it in GitHub Desktop.
Entity Definition of a Movie declaring a To Many relationship to actors
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @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