-->
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.  [ 1 post ] 
Author Message
 Post subject: Binding a named parameter to a user defined java object?
PostPosted: Tue Sep 05, 2006 9:22 pm 
Newbie

Joined: Fri Nov 04, 2005 11:42 am
Posts: 13
Hi

I need to bind a named parameter in my HQL to a java object, what would be the type of the parameter in that case, would it be "Hibernate.OBJECT". So for example, my hql is:
"select user from User user where user.role = :myrole"

Now in the method call query.setParameter("myrole", a_role, Hibernate-type), what will the hibernate type be?

Another similar question is, say my hql is:
"select user from User user where user.role in (:myroles)"

Again for the call query.setParameter("myroles", a_roles, Hibernate-type), what will the hibernate type be? Here a_roles is a set(i.e. collection) of roles. For this particular case, I tried setting it to "Hibernate.OBJECT" but it doesnt seem to work.

Thanks so much.

Neha.


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

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.