persistence@glassfish.java.net

Re: Problem binding collections to queries

From: Jordan Thompson <Jordan_at_ThompCo.com>
Date: Thu, 7 Feb 2008 13:35:44 -0500

How do I get off of this forum???? I cannot find anywhere to remove
myself from the glassfish forum pages.

thanks,
Jordan

On Feb 7, 2008 1:02 PM, Mitesh Meswani <Mitesh.Meswani_at_sun.com> wrote:
> JPA 1.0 does not allow this. It should be nice to have this working.
>
> Work on JPA 2.0 is under way. You can send a comment to JPA2.0 expert
> group (jsr-317-comments_at_jcp.org)to add this feature to the spec.
>
> Christian Kerwer wrote:
> >
> > Hi everyone
> >
> > I'm trying to bind a collection of Ids into a Query like this:
> >
> > Select p from Project p where p.id IN (:IdList)
> >
> > with IdList as Array of Long and field p.id of type Long.
> >
> > It will be quitted with the following exception:
> >
> > java.lang.ClassCastException:
> >
> > You have attempted to set a value of type class [Ljava.lang.Long; for
> > parameter planningObjectIdList with expected type of class
> > java.lang.Long from query string select planObjStrLnk from
> > PlanningObjectStructureLink planObjStrLnk where
> > planObjStrLnk.planningClassStructure.id = :planningClassStructureId
> > and planObjStrLnk.planningObject.id in (:planningObjectIdList)
> >
> > Any Idea?
> >
> > Christian Kerwer
> >
>



-- 
Jordan R. Thompson
Jordan_at_ThompCo.com
www.ThompCo.com