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: pass multiple arguments
PostPosted: Tue Apr 14, 2009 2:48 pm 
Newbie

Joined: Tue Apr 14, 2009 2:44 pm
Posts: 1
Hi Folks,

Any idea how to pass multiple arguments for Hybernate for Select query?

Thanks,


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 14, 2009 5:38 pm 
Regular
Regular

Joined: Tue Dec 30, 2008 8:14 pm
Posts: 50
If this is the query:
select a.*
from tablea a
where a.id_column = :id
and a.name_column = :name

You would need to create a Query object and then set the parameters by name:
query.setParameter("id", 1);
query.setParameter("name", "abc");

---
please 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.