assertEquals(new BigDecimal("2"), author1.countBooks());
assertEquals(new BigDecimal("2"), ora().select(countBooks(author1)).fetchOne(0));
// Get books
author1 = ora().newRecord(U_AUTHOR_TYPE);
GetBooks noBooks = author1.getBooks();
assertNull(noBooks.getBook1().getId());
assertNull(noBooks.getBook1().getTitle());
assertNull(noBooks.getBook2().getId());
assertNull(noBooks.getBook2().getTitle());
author1 = ora().newRecord(U_AUTHOR_TYPE);
author1.setId(1);
GetBooks books = author1.getBooks();
assertEquals(1, (int) books.getBook1().getId());
assertEquals("1984", books.getBook1().getTitle());
assertEquals(2, (int) books.getBook2().getId());
assertEquals("Animal Farm", books.getBook2().getTitle());
// Get books also calls upon load, internally. Check if that's reflected
assertEquals(1, (int) author1.getId());
assertEquals("George", author1.getFirstName());
assertEquals("Orwell", author1.getLastName());