-->
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.  [ 4 posts ] 
Author Message
 Post subject: Custom SQL generation in Hibernate
PostPosted: Wed Apr 27, 2005 3:12 pm 
Newbie

Joined: Wed Apr 27, 2005 3:08 pm
Posts: 2
Hi,

I am new to Hibernate and currently evaluating it. One important thing in the app I am currently working on is to generate SQL statement based on some complex logic at runtime, currently this is done by using special SQL generators we wrote.

If possible, in Hibernate 3, is there anyway to plug in my own SQL generator to handle this kind of senario?

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 27, 2005 3:53 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
depends much on what that "complex sql logic is" - but providing your own Persister or extending the BasicEntityPersister and its friends then you can do about anything you want ,)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 27, 2005 4:00 pm 
Newbie

Joined: Wed Apr 27, 2005 3:08 pm
Posts: 2
one example will be : if (a) then add Where clause1
else if (b) then add where clause2
else ....

In the App, 80% time, sql are predefined, so they can be put into XML, another 20% time, the sql is not known until runtime, in this case, can I handle the way you mentioned?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 27, 2005 4:09 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
yes i would think so - at least you CAN (but i'm not saying its extremely easy ,)

...feature request for specific extensions points is welcome in the jira.

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.