[jboss-user] [JBoss Seam] - hql error using in clause with Session instead of EntityMana

baspet do-not-reply at jboss.com
Mon Feb 11 08:43:17 EST 2008


Hi,

i have a strange exception executing code below:


  | @PersistenceContext EntityManager em;
  | ...
  | 
  | Session session = (Session) em.getDelegate();
  | List<Integer> aList = new ArrayList<Integer>();
  | aList.add(1);
  | aList.add(2);
  | List results = session.createQuery("from MyTable where myField in (:ids)").setParameter("ids", aList).list();
  | 
executing above query results in ClassCastException at IntegerType class.
But, if i use em instead of session, query executed successfully!


  | List results = em.createQuery("from MyTable where myField in (:ids)").setParameter("ids", aList).getResultList();
  | 

I'm not sure if this is a seam bug but any help would be welcomed.

Thanks,
V.


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4128357#4128357

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4128357



More information about the jboss-user mailing list