Skip to content

Instantly share code, notes, and snippets.

@cosbor11
Last active March 29, 2016 04:53
Show Gist options
  • Select an option

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

Select an option

Save cosbor11/4eece591d27bb321f7d2 to your computer and use it in GitHub Desktop.
Fetch the season that you recently created
// Fetch a new copy of the entity so that we can illustrate how eager relationships are fetched
Series theSopranosCopy = (Series)manager.findById(Series.class, theSopranos.seriesId);
// Assert seasons which is an eagerly loaded
assertNotNull("Seasons should be populated because it is eagerly fetched", theSopranosCopy.seasons);
assertTrue("Seasons should be fully populated as an ArrayList", (theSopranosCopy.seasons instanceof ArrayList));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment