users@glassfish.java.net

GlassFish v3.1's EclipseLink complains about parameters not defined in my

From: <forums_at_java.net>
Date: Tue, 12 Jul 2011 10:05:09 -0500 (CDT)

I am migrating an EAR from GFv2 to GFv3.1 and got a weird exception from
EclipseLink:

Exception Description: The parameter name [partVersion] in the query's
selection criteria does not match any parameter name defined in the query.
Query: ReadObjectQuery(name="part" referenceClass=Part sql="SELECT
...(shortened colum list)... FROM t_tl WHERE ((ID_TEILEVERSION = ?) AND
(ID_TEIL = ?))")
 

I am getting this when doing a em.find(ManufacturedAmount.class, ...), since
that class contains a reference to the Part.class mentioned above:

@ManyToOne
@JoinColumns({ @JoinColumn(name = "partId", referencedColumnName =
"ID_TEIL"), @JoinColumn(name = "partVersion", referencedColumnName =
"ID_TEILEVERSION", insertable = false, updatable = false) })
private Part part;
 

In fact, I cannot see where I shall have told EclipseLink to include
"partVersion" in the cascaded SELECT FROM Part! For me it looks like
EclipseLink is picking JoinColumn.name instead of
JoinColumn.referencedColumnName.

Is that a bug in GFv3.1 or am I just too blind to see my own bug?


--
[Message sent by forum member 'mkarg']
View Post: http://forums.java.net/node/821169