[hibernate-dev] HHH-6726 LONG and LONG RAW column types in Oracle
gbadner at redhat.com
Fri Oct 14 21:22:15 EDT 2011
In , I am seeing the following type mappings:
Column type: LONG -> java.sql.Types.LONGVARCHAR -> java.lang.String
Column type: LONGRAW -> java.sql.Types.LONGVARBINARY -> byte
org.hibernate.type.TextType is consistent with the mapping for LONG.
org.hibernate.type.ImageType is consistent with the mapping for LONGRAW.
>From this standpoint, the current settings are appropriate.
I understand there are restrictions when LONG and LONGRAW are used and I see from your other message that there is Oracle documentation for migrating to CLOB and BLOB.
I agree that changing column type registration as follows (for Oracle only) should fix this:
registerColumnType( Types.VARBINARY, 2000, "raw($l)" );
registerColumnType( Types.VARBINARY, "blob" );
registerColumnType( Types.LONGVARCHAR, "clob" );
registerColumnType( Types.LONGVARBINARY, "blob" );
registerColumnType( Types.VARCHAR, 4000, "varchar2($l char)" );
registerColumnType( Types.VARCHAR, "clob" );
Steve, what do you think? Is it too late to make this change for 4.0.0?
 Table 11-1 of Oracle® Database JDBC Developer's Guide and Reference, 11g Release 1 (11.1) (http://download.oracle.com/docs/cd/B28359_01/java.111/b31224/datacc.htm#g1028145)
 Hibernate Core Migration Guide for 3.5 (http://community.jboss.org/wiki/HibernateCoreMigrationGuide35)
 Table 2-10 of Oracle® Database SQL Language Reference
11g Release 1 (11.1) (http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/sql_elements002.htm#g195937)
----- Original Message -----
> From: "Łukasz Antoniak" <lukasz.antoniak at gmail.com>
> To: hibernate-dev at lists.jboss.org
> Sent: Thursday, October 13, 2011 12:50:13 PM
> Subject: [hibernate-dev] HHH-6726 LONG and LONG RAW column types in Oracle
> Welcome Community!
> I have just subscribed to the list and wanted to discuss HHH-6726
> Gail Badner wrote
> HHH-6726 (Oracle : map TextType to clob and ImageType to blob)
> There have been a number of issues opened since the change was made
> map TextType (LONGVARCHAR) 'long' and ImageType (LONGVARBINARY) to
> raw'. This change was already documented in the migration notes.
> the mapping for Oracle (only) be changed back to clob and blob?
> HHH-6726 is caused by an issue in Oracle JDBC driver (version
> and later). This bug appears when LONG or LONG RAW columns are
> not as first or last while processing SQL statement.
> I have discussed the topic of mapping TextType to CLOB and ImageType
> BLOB (only in Oracle dialect) with Strong Liu. Reasons for doing so:
> - Oracle allows only one LONG / LONG RAW column per table. This might
> the most important from Hibernate's perspective.
> - LONG / LONG RAW - up to 2 GB, BLOB / CLOB - up to 4 GB.
> - In PL/SQL using LOBs is more efficient (random access to data).
> only sequential.
> - LONG and LONG RAW are deprecated.
> What is your opinion?
> Lukasz Antoniak
> hibernate-dev mailing list
> hibernate-dev at lists.jboss.org
More information about the hibernate-dev