-->
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: Registering functions to use native sql queries
PostPosted: Mon Apr 14, 2008 11:57 am 
Newbie

Joined: Tue Oct 02, 2007 10:42 am
Posts: 10
Hi,

I am using Hibernate 3.0 with an oracle database. Basically, I need to call the in built oracle "replace" function from my code.
So I used the session.createSQLQuery() and ran it as a native query and not as an HQL. However I find this approach rather cumbersome and prefer using HQL as its much cleaner.
I looked up the hibernate documentation and found the following link:

http://www.hibernate.org/118.html#A26

As per this link, hibernate can be used to call SQL functions by "Subclass your Dialect, and call registerFunction() from the constructor".

Would doing the above enable me to call built in oracle functions from an HQL? Also, does anyone have any code samples for sub-classing the oracle dialect and registering a function?

Thanks in advance!


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.