Hey,
Through some wacky querying I came across this:

http://n2.nabble.com/Persistent-entities-pass-as-params-to-JPQL-queries-MUST-be-attached-Query-getSingleResult-bug-or-exp-td209033.html

I tried to verify this but could not. Here's a simple attempt:

User user = new User();
user.setId(userId);
Query query = em.createQuery("select o from ScheduledAssignment as o where
o.user = :user");
query.setParameter("user", user);
System.out.println(query.getSingleResult()); // also works with
getResultList (there's only one)

This works just fine. Can anyone set the issue straight? Thanks.

-- 
Daryl Stultz
_____________________________________
6 Degrees Software and Consulting, Inc.
http://www.6degrees.com
mailto:[email protected]

Reply via email to