Issue Type: Bug Bug
Affects Versions: 3.6.10
Assignee: Unassigned
Components: core
Created: 30/Oct/12 7:32 AM
Description:

For Oracle databases, Hibernate maps 'text' datatype to the LONG column type, which shouldn't be used anymore (please see http://docs.oracle.com/cd/B28359_01/server.111/b28318/datatype.htm#CNCPT1831).

For example, the following GORM domain class will be mapped to a table with a 'content' column of type LONG:

class Message
{
    String content

    static mapping = {
        content type: 'text'
    }
}

Additionally, if there is more than one 'text' column, creation of the table will result in "ORA-01754: a table may contain only one column of type LONG", e.g. for the following class:

class Message
{
    String content
    String other

    static mapping = {
        content type: 'text'
        other type: 'text'
    }
}

The correct behavior would be to create columns of type CLOB. This is not a Grails issue, because the 'text' type is passed to Hibernate and Grails relies on Hibernate in this case.

Using CLOB instead of LONG can be achieved on the application level by adding 'clob' sqlType as a workaround, like in the following example:

class Message
{
    String content
    String other

    static mapping = {
        content type: 'text', sqlType: 'clob'
        other type: 'text', sqlType: 'clob'
    }
}

but it's only a workaround and doesn't resolve this problem at the source.

The default behavior of Hibernate can prevent tables from being created (ORA-0175) and causes creation of tables with a deprecated column type.

Environment: Grails 2.0.4, Oracle 11g
Project: Hibernate ORM
Priority: Major Major
Reporter: Konrad Strack
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira