I have Hibernate generated classes that contain other classes -
public class BookLoans implements java.io.Serializable { private BookLoansId id; private Borrower borrower; private LibraryBranch libraryBranch; private Book book; private Date dateOut; private Date dueDate; } where BookLoansId is -
public class BookLoansId implements java.io.Serializable { private int bookId; private int branchId; private int cardNo; } which are primary keys in the tables Book, LibraryBranch and Borrower respectively. When I run this query -
sessionFactory.getCurrentSession().createSQLQuery( "select * from library.tbl_book_loans l where cardNo = 4"); Hibernate returns a list of Object[] elements. If I try to iterate through this list, I get null objects. I've tried a couple of different methods from here and here.
Is there any way to find out how the objects are arranged within each Object[]?