@Before public void setupTestData() { Session s = openSession(); Transaction tx = s.beginTransaction(); Calendar dob = Calendar.getInstance(TimeZone.getTimeZone("UTC"), Locale.ENGLISH); dob.set(1958, 3, 7, 0, 0, 0); dob.set(Calendar.MILLISECOND, 0); GolfPlayer hergesheimer = new GolfPlayer.Builder() .firstName("Klaus") .lastName("Hergesheimer") .active(true) .dateOfBirth(dob.getTime()) .handicap(3.4) .puttingStrength(2.5) .driveWidth(285) .strength("precision") .strength("willingness") .strength("stamina") .build(); s.persist(hergesheimer); GolfPlayer galore = new GolfPlayer.Builder().lastName("Galore").ranking(311).build(); s.persist(galore); GolfPlayer kidd = new GolfPlayer.Builder().lastName("Kidd").build(); s.persist(kidd); GolfCourse purbeck = new GolfCourse("Purbeck", 127.3, new Hole(433, (byte) 4), new Hole(163, (byte) 3)); s.persist(purbeck); GolfCourse mountMaja = new GolfCourse("Mount Maja", 111.9, new Hole(512, (byte) 5), new Hole(113, (byte) 3)); s.persist(mountMaja); GolfPlayer brand = new GolfPlayer.Builder().lastName("Brand").playedCourses(purbeck, mountMaja).build(); s.persist(brand); purbeck.getPlayedBy().add(brand); mountMaja.getPlayedBy().add(brand); s.persist(brand); tx.commit(); s.close(); }