Created
March 27, 2016 05:35
-
-
Save cosbor11/78f5055060ead2088b3d to your computer and use it in GitHub Desktop.
Create test data for movie and actor entities
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
| // Populate the movie data with actors //1 | |
| Movie starWarsMovie = new Movie(); | |
| starWarsMovie.title = "Star Wars, A new Hope"; | |
| ArrayList<Actor> actors = new ArrayList<>(); | |
| Actor markHamil = new Actor(); | |
| markHamil.actorId = 1; | |
| markHamil.firstName = "Mark"; | |
| markHamil.lastName = "Hamil"; | |
| Actor carrieFisher = new Actor(); | |
| carrieFisher.actorId = 2; | |
| carrieFisher.firstName = "Carrie"; | |
| carrieFisher.lastName = "Fisher"; | |
| actors.add(markHamil); | |
| actors.add(carrieFisher); | |
| // Save The movie and actors | |
| manager.saveEntity(markHamil); | |
| manager.saveEntity(carrieFisher); | |
| manager.saveEntity(starWarsMovie); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment