Improve support for mapping SQL LONGVARCHAR and CLOB to Java String, SQL LONGVARBINARY and BLOB to Java byte[]

Description

Property types will be provided to enable an application to process data for a java.sql.Types.LONGVARCHAR or java.sql.Types.CLOB column as a Java String. Hibernate will internally process the data as a streams. On a read, stream data will immediately be materialized into a Java string.

text - property type to map java.sql.Types.LONGVARCHAR column data as a Java String (via org.hibernate.type.TextType);
(NOTE: currently, org.hibernate.type.TextType incorrectly maps "text" to java.sql.Types.CLOB; this will be fixed by this issue and updated in database dialects)

materialized_clob - property type to map java.sql.Types.CLOB column data as a Java String (via org.hibernate.type.MaterializedClobType);

In addition, new property types will be provided to enable an application to process data for a java.sql.Types.LONGVARBINARY or java.sql.Types.BLOB column as Java byte[]. Hibernate will internally process the data as a streams. On a read, stream data will immediately be materialized into a Java byte[].

image - property type to map java.sql.Types.LONGVARBINARY column data as byte[] (via org.hibernate.type.ImageType);

materialized_blob - property type to map java.sql.Types.BLOB column data as byte[] (via org.hibernate.type.MaterializedBlobType);

Activity

Show:

MeM January 19, 2012 at 11:12 PM

This changeset above broke compatibility with at least 3.4.2.GA.

See here for more details:

https://forum.hibernate.org/viewtopic.php?f=1&t=1014208

What is the workaround?

Steve Ebersole March 21, 2011 at 7:08 PM

Bulk closing stale resolved issues

Former user August 17, 2009 at 12:31 PM

Fixed in trunk.

Former user June 17, 2009 at 10:39 PM

Updated org.hibernate.dialect.Dialect to register Types.LONGVARCHAR and Types.LONGVARBINARY to hibernate "text" and "image", respectively.

I added some tests for selecting "image" and "text" properties using native SQL and some tests for overriding CRUD operations for entities containing an "image" or "text" property.

Fixed

Details

Assignee

Reporter

Components

Fix versions

Priority

Created May 2, 2009 at 1:17 AM
Updated January 20, 2012 at 1:46 AM
Resolved August 17, 2009 at 12:31 PM