[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: native query and

dkane do-not-reply at jboss.com
Tue Dec 11 06:06:18 EST 2007


"Soon5" wrote : Hy,
  | 
  | I had some Problems with count(*) in the past. Try to use count(IDColumn) or another not null column.
  | 
  | Greetings Soon5


Thank you for the idea. 

Got a workaround by replacing count(*) with : 
 
  List l = (List)
  |     em.createNativeQuery("SELECT uId FROM Users_Terminals ut where "+
  |             "tId=" + termId + " and uId=" +userId).getResultList();
  |   return(l!=null && l.size()>0 && ((Integer)(l.get(0))).intValue()>0);
  | 

But still interesting .. 

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

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



More information about the jboss-user mailing list