Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

@SqlResultSetMapping with more than one EntityResults + left join

843830Sep 21 2009
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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 19 2009
Added on Sep 21 2009
0 comments
453 views