-->
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.  [ 3 posts ] 
Author Message
 Post subject: does limit function work with hibernate
PostPosted: Wed Jun 22, 2005 8:49 am 
Newbie

Joined: Tue Jun 21, 2005 6:18 am
Posts: 4
Location: Kerala-India
hi forum,

"delete from Accessed as acc where acc.userid=:user_id order by acc.dat limit 1 ";


does this query work with hibernate?
does limit function work with hibernate?

i am new to hibernate concepts.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 22, 2005 10:46 am 
Expert
Expert

Joined: Wed Apr 06, 2005 5:03 pm
Posts: 273
Location: Salt Lake City, Utah, USA
No, but look at Query.setMaxResults()


Top
 Profile  
 
 Post subject: how to use setParamter() to set date ?
PostPosted: Thu Jun 23, 2005 12:37 am 
Newbie

Joined: Tue Jun 21, 2005 6:18 am
Posts: 4
Location: Kerala-India
hi

this is my query:
delete from Accessed as acc where acc.userid=:user_id and acc.dat=:min_date

how should i set the parameter "min_date" using the setParameter method ?

mindate contains the date object to be set in the query.

what change should i make to the below stated code to work correctly?
query2.setParameter("min_date", mindate, Hibernate.DATE);


this is only my second request to the forum. yesterday i got a fine reply from the forum. thanks a lot hibernate forum...


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.