[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Hibernate 3.2 aggregation functions change
mraben
do-not-reply at jboss.com
Tue Nov 7 09:25:45 EST 2006
Hi everyone,
Hibernate3.2 Migration Guide http://www.hibernate.org/250.html#A42
mentions "Changed aggregation (count, sum, avg) function return types".
To use the classic pre Hibernate 3.2 aggregation functions, the following help is given:
----
If you cannot change to the JPA compliant type handling the following code can be used to provide "classic" Hibernate behavior for HQL aggregation.
Configuration classicCfg = new Configuration();
classicCfg.addSqlFunction( "count", new ClassicCountFunction());
classicCfg.addSqlFunction( "avg", new ClassicAvgFunction());
classicCfg.addSqlFunction( "sum", new ClassicSumFunction());
SessionFactory classicSf = classicCfg.buildSessionFactory();
----
Is something like this also possible in declarative instead of programmatic configuration?
My Hibernate configuration is deployed in JBoss AS 4.0.5 via a har archive, and i don´t know, how to switch to the old aggregation functions there.
Thanks for your help.
Markus
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3983765#3983765
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3983765
More information about the jboss-user
mailing list