Dear Hibernate admins & forum users,
I have a problem with Oracle and SchemaUpdate tool. I think that I isolated the problem very precisely. I am trying to map a binary field with a default value "true". This mapping works with PostgreSQL and MySQL but fails with Oracle. The exact problem is theat SchemaUpdate tries to run the following query:
Code:
create table nova_gateway_t (gateway_id number(10,0) not null, enabled number(1,0) default true, primary key (gateway_id))
The problem lies with the
"true" default value. In this case, since hibernate changed the physical column type to number(1,0), shouldn't it also change the default value to 1 ?
Thank you in advance for your help.
Hibernate version: 3.2.5.ga
Mapping documents:Code:
<class name="com.aginova.storage.Gateway" table="nova_gateway_t">
<id name="gateway_id" type="integer" unsaved-value="null">
<column name="gateway_id" length="10" not-null="true"/>
<generator class="increment"/>
</id>
<property name="enabled" type="boolean">
<column name="enabled" not-null="false" default="true"/>
</property>
</class>
Code between sessionFactory.openSession() and session.close():Actually before that:
Code:
new SchemaUpdate(configuration).execute(true, true);
Full stack trace of any exception that occurs:
Quote:
2008-06-30 15:43:25,406 ERROR [HTTPThreadGroup-4] (SchemaUpdate.java:155) - Unsuccessful: create table nova_gateway_t (gateway_id number(10,0) not null, enabled number(1,0) default true, primary key (gateway_id))
2008-06-30 15:43:25,406 ERROR [HTTPThreadGroup-4] (SchemaUpdate.java:156) - ORA-00984: Un nom de colonne n'est pas autorisé ici
Name and version of the database you are using:
Oracle Database 10g Express Edition Release 10.2.0.1.0
The generated SQL (show_sql=true):
N/A
Debug level Hibernate log excerpt:
N/A