Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] NamedNativeQuery, SqlResultSetMapping and left outer join

Hi,
I am using a NamedNativeQuery that uses an OUTER LEFT JOIN.  I am using SqlResultSetMapping to get the columns that I want (I don't need all the columns from the 6 tables).  The return list is an object array of the entities with what I was hoping to be populated with the properties that I need.
 
The exception I am getting is:
 
Exception Description: The primary key read from the row [DatabaseRecord( ... )] during the execution of the query
was detected to be null.  Primary keys must not contain null.
 
Which I am assuming that since the entities I am using have Id annotated properties, those properties can't be null (which makes sense).  But the nature of the OUTER LEFT JOIN is to retrieve those null values in table B for each entry in table A.
 
Should I be doing this another way ?
 
Thanks.

Back to the top