-->
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: dynamic mapped statements
PostPosted: Wed Jun 30, 2004 12:43 pm 
Newbie

Joined: Wed Jun 30, 2004 12:37 pm
Posts: 9
Hi,
I am a new Hibernate user and I was really impressed by the available features. However, I would like to know whether Hibernate contains something like dynamic mapped statements of iBatis. If it dosen't, what's the best way to generate queries for search forms where not all the fields are required ?
Thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 30, 2004 1:08 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
We use Query By Criteria and Query By Example, see the documentation and API of Session.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 01, 2004 1:23 am 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
Most of queries you can implement as static too. There is no problems in optional parameters, but query optimizer can fail to find good plan with this trick:
Code:
... ( firstName = ? OR ? IS  NULL) AND ( lastName = ? OR ?  IS NULL ) ...


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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.