Hi all, I'm new to hibernate and I've crossed a problem. I try executing an select which returns real from postgresql, but it throws an exception: "org.hibernate.MappingException: No Dialect mapping for JDBC type: 7".
If I remove the real field from my select, it works fine, but I need it in order to develop my application. Now, I've read a forum in which it said tu custom my dialect for suporting decimals. This is my custom class:
package myPackage;
import java.sql.Types;
import org.hibernate.Hibernate;
import org.hibernate.dialect.PostgreSQLDialect;
public class CustomPostgreSQLDialect extends PostgreSQLDialect{
public CustomPostgreSQLDialect(){
super();
registerHibernateType(Types.DECIMAL, Hibernate.DOUBLE.getName() );
}
}
and I load it like this in hibernate.cfg.xml:
<property name="dialect">myPackage.CustomPostgreSQLDialect</property>
do you have any idea how to resolv my error and to be able to perform decimals selects?
I'm using hibernate 3.2
|