I have three tables / classes that I retrieve using left outer join. I execute the following query:
List<Object[]> l = session.createSQLQuery("SELECT a.*, b.*, c.* " + " FROM (table_a a INNER JOIN table_b b ON a.some_id = b.some_id) " + " LEFT OUTER JOIN table_c c ON c.some_id = a.some_id" ).addEntity("a", A.class).addEntity("b", B.class).addEntity("c", C.class).list();
The request fails if the rows in A and B exist, but in C there is no corresponding row, since hibernate is trying to assign null values ββto non-zero attributes in C (I cannot change these attributes as nullable). Is there a parameter in sleep mode for returning a null object for C if a line in C does not exist and is not trying to create an object with null values?
source share