@Before public void setUp() { if (query().from(cat).exists()) { savedCats.addAll(query().from(cat).orderBy(cat.id.asc()).list(cat)); return; } Cat prev = null; for (Cat cat : Arrays.asList( new Cat("Bob123", 1, 1.0), new Cat("Ruth123", 2, 2.0), new Cat("Felix123", 3, 3.0), new Cat("Allen123", 4, 4.0), new Cat("Mary_123", 5, 5.0))) { if (prev != null) { cat.addKitten(prev); } cat.setBirthdate(birthDate); cat.setDateField(date); cat.setTimeField(time); save(cat); savedCats.add(cat); prev = cat; } Animal animal = new Animal(10); animal.setBodyWeight(10.5); save(animal); Cat cat = new Cat("Some", 6, 6.0); cat.setBirthdate(birthDate); save(cat); savedCats.add(cat); Show show = new Show(1); show.acts = new HashMap<String, String>(); show.acts.put("a", "A"); show.acts.put("b", "B"); save(show); Company company = new Company(); company.id = 1; company.ratingOrdinal = Company.Rating.A; company.ratingString = Company.Rating.AA; save(company); Employee employee = new Employee(); employee.id = 1; employee.lastName = "Smith"; employee.jobFunctions.add(JobFunction.CODER); save(employee); Employee employee2 = new Employee(); employee2.id = 2; employee2.lastName = "Doe"; employee2.jobFunctions.add(JobFunction.CODER); employee2.jobFunctions.add(JobFunction.CONSULTANT); employee2.jobFunctions.add(JobFunction.CONTROLLER); save(employee2); save(new Entity1(1)); save(new Entity1(2)); save(new Entity2(3)); Foo foo = new Foo(); foo.id = 1; foo.names = Arrays.asList("a", "b"); foo.bar = "München"; save(foo); }