Skip to content

Instantly share code, notes, and snippets.

@cosbor11
Created March 27, 2016 05:35
Show Gist options
  • Select an option

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

Select an option

Save cosbor11/78f5055060ead2088b3d to your computer and use it in GitHub Desktop.
Create test data for movie and actor entities
// 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