Hibernate version: 3.2.6
Name and version of the database you are using: Derby
I am trying to use @Type annotation to use a custom UserType that maps Blob to byte[]. (See
http://www.hibernate.org/73.html)
Here is the code that tries to use this annotation -
@TypeDefs (
{
@TypeDef(
name="MyBlob", typeClass=mypackage.MyBlobType.class
)
}
)
@Entity
@Table(name="MY_TABLE")
public class MyClass {
private byte[] _objData;
@Type(type="MyBlob")
public void setObjData(byte[] objData) {
this._objData = objData;
}
public byte[] getObjData() {
return _objData;
}
}
PROBLEM
------------
When I generate the ddl, the column corresponding to byte[] still gets mapped to varchar for bit data which is the default mapping for byte[] and not to Blob as per my custom user type.
Does anyone know if the @Type annotation works ?