Hi,
Using Hibernate 2.1.4 to create schema from a mapping document containing :
Code:
<property name="cert" type="binary" not-null="false" length="1500">
</property>
<property name="pkcs" type="binary" not-null="false" length="6000">
</property>
with the Oracle9Dialect results in a SQL create statement like :
Code:
create table xxx(
...
cert LONG RAW,
pkcs LONG RAW,
...)
Which fails because Oracle does not support more than 1 LONG column.
However, I believe Oracle supports up to 2000 bytes per RAW column, so why does the Dialect map my first property (cert, with a length of 1500) to LONG RAW when RAW(1500) would be better?
I looked at the Oracle9Dialect class, and changing line 31 from :
Code:
registerColumnType( Types.VARBINARY, 255, "RAW($l)" );
to:
Code:
registerColumnType( Types.VARBINARY, 2000, "RAW($l)" );
this fixed the problem, and the schema was generated with the RAW(1500) and ran correctly against the DB.
Is there a reason for not allowing RAWs longer than 255 bytes in the Oracle9Dialect?
I am trying to store 2 byte arrays in one table, is there a better approach than type="binary"? I'd rather not base64 encode them and then store as strings....
regards,
Brett