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
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to