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: Adding custom SQLFunctions with JPA
PostPosted: Tue Nov 04, 2008 8:14 am 
Newbie

Joined: Fri May 04, 2007 8:14 am
Posts: 4
Hibernate version:
Core: 3.2.4.sp1
Entity Manager: 3.3.1.GA
Annotations: 3.3.0.GA

Name and version of the database you are using:
MySQL 5

I need to be able to add a custom SQLFunction but the only way to do this that I'm aware of is by calling Configuration.addSqlFunction(). Ejb3Configuration instantiates the hibernate Configuration and builds a SessionFactory from it but, as far as I can see, provides no hooks to add SQLFunctions. Unfortunately, creating a patched build of hibernate and altering the MySQLDialect is not an option for me.

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 04, 2008 8:49 am 
Newbie

Joined: Fri Jul 14, 2006 12:05 pm
Posts: 19
Couldn't you just subclass MySQL5Dialect and change the dialect property in the persistence settings to be your subclass?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 04, 2008 12:58 pm 
Newbie

Joined: Fri May 04, 2007 8:14 am
Posts: 4
Yup, that worked a treat, thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 04, 2008 3:15 pm 
Newbie

Joined: Fri Jul 14, 2006 12:05 pm
Posts: 19
Glad it worked for you. Feel free to rate the response as helpful :-).


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.