-->
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: How can I query using a map of (field, field-value) ????
PostPosted: Wed Aug 25, 2004 12:59 pm 
Newbie

Joined: Thu Aug 12, 2004 9:32 am
Posts: 17
Hibernate version:2.1.6

Hi, I am looking for an example of a dynamic query.

let say I have a map containing :
String field-name, Object field-value.

I need to pass to the query :
1) query string --> no problem "where field-name = ? "
2) object array --> i can assemble that from a vector of objects
3) Hibernate Types Array ---> how do I assemble that ???

must I translate from each type to Hibernate Type ?
for example if i have java.lang.String I need to send Hibernate.STRING

what is the proper way of doing that ????


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 25, 2004 3:40 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
You can get it from class metadata. Or use the criteria api it seems more reasonable for what you are doing.


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.