@SqlResultSetMapping with more than one EntityResults + left join
Hi!
The problem:
sql query:
select a.*, b.* from a left join b on a.field1 = b.field1
@SqlResultSetMapping(name = "myResultMapping",
entities = {
@EntityResult(entityClass = A.class),
@EntityResult(entityClass = B.class)
})
Caused by: Exception [TOPLINK-6044] (Oracle TopLink Essentials - 2.0.1 (Build b04-fcs (04/17/2008))): oracle.toplink.essentials.exceptions.QueryException
Exception Description: The primary key read from the row [DatabaseRecord(
B.field1 => null
B.field2 => null
B.field3 => null] during the execution of the query was detected to be null. Primary keys must not contain null
Does anyone know how I can tell Toplink not to try to create an object from the all-null group of fields but just return a null instead?
Thanks!
Agoston