-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Problem with OneToOne mapping, possibly a bug
PostPosted: Tue Jan 04, 2011 8:00 pm 
Newbie

Joined: Sat Jan 01, 2011 5:43 pm
Posts: 4
Hello,

I have a problem with OneToOne mapping and it works correct with EclipseLink 2.0.2 so I suppose it could be a bug.

I have following mapping:
Code:
public class Vehicle implements Serializable {
    .....
    @OneToOne(optional=true, fetch=FetchType.LAZY)
    @PrimaryKeyJoinColumn
    private CdsNotIdentified cdsNotIdentified;
====================================================
public class CdsNotIdentified implements Serializable {
   
    @OneToOne(optional=false)
    @PrimaryKeyJoinColumn
    private Vehicle vehicle;


Which is bidirectional OneToOne, lazy and optional from one side. Two tables share the same PK.

The problem is when i execute query
Code:
            SELECT ni
            FROM CdsNotIdentified ni
            WHERE ni.vehicle = :vehicle

it says "java.sql.SQLException: No value specified for parameter 2"
The query executing is select cdsnotiden0_.vehicle_id as vehicle1_2_, cdsnotiden0_.lastConnectTime as lastConn2_2_ from cdsNotIdentified cdsnotiden0_ where cdsnotiden0_.vehicle_id=? limit ?
And I suppose that it does not set vehicle_id but sets limit to the first parameter, and the second stays unset. (as I interpreted the debugging process)

Is it a bug and is there a solution?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.