I'm porting an application written for Sybase and Hibernate 3.6.4 to start using Oracle 11g. As I understand people were able to get Hibernate working with Oracle 11g using Oracle10gDialect. I'm using that but for one of the columns which is mapped java.lang.Double I'm having issues.
When I create the table with the column as BINARY_DOUBLE, hibernate complains saying:
Caused by: org.hibernate.HibernateException: Wrong column type in TEST_SCHEMA.TEST_TABLE for column PERCENTAGE. Found: binary_double, expected: double precision
and when I define the column as DOUBLE PRCEISION, it complains saying:
Caused by: org.hibernate.HibernateException: Wrong column type in TEST_SCHEMA.TEST_TABLE for column PERCENTAGE. Found: float, expected: double precision
Looking at the docs both of these errors make sense because there's no Double data type in Oracle. But looking at the Dialect code, I'm not sure why I'm seeing the second error.
Class org.hibernate.dialect.Oracle8iDialect has this method which has "double precision" mapped to Types.DOUBLE
protected void registerNumericTypeMappings() {
registerColumnType( Types.BIT, "number(1,0)" );
registerColumnType( Types.BIGINT, "number(19,0)" );
registerColumnType( Types.SMALLINT, "number(5,0)" );
registerColumnType( Types.TINYINT, "number(3,0)" );
registerColumnType( Types.INTEGER, "number(10,0)" );
registerColumnType( Types.FLOAT, "float" );
registerColumnType( Types.DOUBLE, "double precision" );
registerColumnType( Types.NUMERIC, "number($p,$s)" );
registerColumnType( Types.DECIMAL, "number($p,$s)" );
}
So, I'm not sure why DOUBLE PRECISION is not working for me. Any pointers on what I'm doing wrong here. I'm sure those who have tested Oracle11gDialect would have used Double in their code.
Thanks, K.