]
Eric Shoemaker commented on HHH-2614:
-------------------------------------
Thank you for fixing this.
Blob Length Set to 255 By Default With Derby DB
-----------------------------------------------
Key: HHH-2614
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2614
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.2.3
Environment: Apache Derby 10.2.2, Java 1.6.0
Reporter: Sean Sylvis
Assignee: Strong Liu
Fix For: 3.6.6, 4.0.0.next
When the (Hibernate) type "blob" is used in an object mapping file and a length
is not specified, Hibernate converts this type as "blob (255)" to the Apache
Derby database table definition. (This seems to be the same as the conversion behavior of
a Java String to "varchar (255).") The same behavior results when using a
CustomType that returns a Java SQL Types.BLOB. This is not the behavior I expected.
Hibernate converts the same type as simply "blob" (which has a maximum length
of 65535 bytes when no length is specified) when using MySQL version 5.0
(
http://dev.mysql.com/doc/refman/5.0/en/storage-requirements.html). Furthermore, the Derby
specification (
http://db.apache.org/derby/docs/10.2/ref/rrefblob.html) states that a blob
type without a length value will default to a length of 2M-1 bytes.
I could not find a length specification for the Java SQL Blob type
(
http://java.sun.com/javase/6/docs/api/), but the current default length does seem to
conform to other Hibernate type standards. That is, if a length is not specified, the
length defaults to the maximum length defined for that type by the database.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: