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.  [ 5 posts ] 
Author Message
 Post subject: Where is Configuration.AddSqlFunction?
PostPosted: Wed Jan 31, 2007 8:49 am 
Newbie

Joined: Wed Jan 31, 2007 8:44 am
Posts: 9
Hi to everyone, reading documentation at http://www.hibernate.org/407.html I read that there is a function called AddSqlFunction to add function to a dialect without the need to subclass a Dialect but I cannot find in 1.2.0 beta3 release.

Moreover I tried to subclass a Dialect to introduce a new function, but even if I register the new function, when I use it into a query the parser ignore it and pass the function name unmodified into the query.

Thanks to everyone for any help.

Alk.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 31, 2007 8:59 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
The function will be there in the CR1 release. It's possible that you can't add/override functions, I'll check this and update the page accordingly, thanks for the notice.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 31, 2007 9:40 am 
Newbie

Joined: Wed Jan 31, 2007 8:44 am
Posts: 9
Thank you very much for the quick reply.

Is there any tutorial around that explain how to extend a dialect with subclassing? Ii tried to build a class like this

public class Sql2000Extended : NHibernate.Dialect.MsSql2000Dialect {

public Sql2000Extended() : base() {

this.RegisterFunction(
"ExBitwiseAnd",
new Sql2000BitwiseAndFunction("ExBitwiseAnd", NHibernate.NHibernateUtil.Int32));
}
}

With corresponding Sql2000BitwiseAndFunction that simulates a bitwise operation, then I changed App.config to load this new dialect but when I use ExBitwiseAnd function in HQL query I see from the profiler that the ExBitwiseAnd function is not translated.

Thanks a lot.

Alk.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 01, 2007 5:52 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
You can't currently override functions in Dialect or through Configuration. I removed the relevant paragraph from the migration guide.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 01, 2007 6:03 am 
Newbie

Joined: Wed Jan 31, 2007 8:44 am
Posts: 9
sergey wrote:
You can't currently override functions in Dialect or through Configuration. I removed the relevant paragraph from the migration guide.


Ok, I understand, so in actual implementation there is not the possiblity to use custom functions. Thanks a lot for the explanation. :)

Alk.


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