-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Criteria query with Long data type.
PostPosted: Tue Mar 18, 2008 7:02 pm 
Newbie

Joined: Mon Mar 17, 2008 2:09 pm
Posts: 8
Hi All,

'Ticket Id' property in hibernate class is defined as 'Long' data type. In data base it is having row for TicketId# 69 and I'm using below criteria for getting the data for this record

Criteria crit = HibernateUtil.getSessionFactory() .getCurrentSession().createCriteria(HelpManager.class);
crit.add(Expression.idEq(TicketNo));
result = crit.list();


In log, it is created below query:

In HelpManager submitCriteria TicketNo:69
Hibernate: select this_.TICKET_ID as TICKET1_3_0_, this_.PROJECT_NAME as PROJECT2_3_0_, this_.MODIFIED_BY as MODIFIED10_3_0_, this_.MODIFIED_DT as MODIFIED11_3_0_ from USER_COMMENTS this_ where this_.TICKET_ID = ?

It is not throwing any error but it is not retrieving any records.

Thanks in advance.

Regards,
Sharath.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 19, 2008 9:33 pm 
Expert
Expert

Joined: Thu May 26, 2005 9:19 am
Posts: 262
Location: Oak Creek, WI
Can you show your mapping..

Just runa quick test like..

Criteria crit = HibernateUtil.getSessionFactory() .getCurrentSession().createCriteria(HelpManager.class);
crit.add(Expression.idEq(69L));
result = crit.list();


Check to see if you get the result...

_________________
RamnathN
Senior Software Engineer
http://www.linkedin.com/in/ramnathn
Don't forget to rate.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.