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?