Hi,
according to a previous posting
http://forum.hibernate.org/viewtopic.php?t=959583&highlight=mapping+jdbc+dialect+oracle I subclassed DB2Dialect and extended the constructor to:
Code:
super();
// enable Decimal type in Hibernate SQLQueries
registerColumnType(Types.DECIMAL, "number($p,$s)");
registerHibernateType(Types.DECIMAL, "big_decimal");
// enable Decimal function in Hibernate Queries
registerFunction("decimal", new StandardSQLFunction("decimal", Hibernate.BIG_DECIMAL));
This way it works but two questions arose:
Is it the recommended way to enable Decimal type and function?
What's the reasons why these type/function is not included in DB2Dialect (maybe I will run into problems in the future)?
Thanks
Walter
p.s.
Hibernate version: 3.1.1
Name and version of the database you are using:DB2 UDB 8.2
extract of hibernate.cfg.xml:Code:
<property name="hibernate.connection.driver_class">com.ibm.db2.jcc.DB2Driver</property>
<property name="hibernate.dialect">org.hibernate.dialect.DB2Dialect</property>