Search code examples
oracle-databasespring-roo

Spring Roo 1.2.5 + Oracle database = ORA-00902: invalid datatype


Using an Oracle 11g Express Edition 11.2.0.2.0 database, I have a simple project using the following Roo script:

// Spring Roo 1.2.5.RELEASE [rev 8341dc2] log opened at 2014-09-10 17:06:13
project --topLevelPackage com.example --java 7 --packaging jar --projectName TestBug
jpa setup --provider HIBERNATE --database ORACLE --hostName 192.168.3.44
// Edits to database.properties to allow access to Oracle XE 
entity jpa --class ~.domain.AbstractTestClass --abstract
field string --fieldName stringName
entity jpa --class ~.domain.ConcreteTestClass --extends ~.domain.AbstractTestClass --testAutomatically 
// Test succeeds
perform test
field boolean --fieldName testField
// Test fails
perform test

The failing test results in the following error:

HHH000389: Unsuccessful: create table abstract_test_class (dtype varchar2(31) not null, id 
number(19,0) not null, string_name varchar2(255), version number(10,0), monkey boolean, primary
key (id)) 2014-09-10 17:24:36,534 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaExport - 
ORA-00902: invalid datatype

This is with a "hibernate.hbm2ddl.auto" setting of create-drop and ensuring the database is clean on the test run.

Is there a datatype other than boolean that should be used in this scenario?


Solution

  • The easy way to solve this could be specify the final column type on property:

       @Column(columnDefinition="NUMBER(1)")
       private boolean testField;
    

    I found a bug on hibernate-jira about it but still unresolved.

    Good luck!