I'm trying to control the length of a BLOB column using the DB2 schema. My final goal is to have hibernatetool generate the SQL file for a 10M long BLOB column, and given the files pasted down here I always get a blob(255). What am I doing wrong?
build.xml (omitted less relevant parts):
Code:
<taskdef name="hibernatetool"
classname="org.hibernate.tool.ant.HibernateToolTask"
classpathref="toolslib" />
<target name="default">
<hibernatetool destdir="./generated">
<classpath>
<path location="." />
<path location="./classes" />
</classpath>
<configuration configurationfile="hibernate.cfg.xml"/>
<hbm2ddl export="false" outputfilename="sql.ddl"/>
</hibernatetool>
hibernate.cfg.xml:
Code:
<hibernate-configuration>
<session-factory>
<property name="dialect">org.hibernate.dialect.DB2Dialect</property>
<!-- Mapping files -->
<mapping resource="DbContentStream.mapping.xml"/>
</session-factory>
</hibernate-configuration>
DbStreamImpl mapping:
Code:
<hibernate-mapping>
<class name="DbContentStreamImpl"
table="CONTENT_STREAM">
<cache usage="read-write"/>
<id name="id" type="java.lang.Long" access="field">
<column name="id"/>
<generator class="native">
</generator>
</id>
<property name="content" type="blob" length="10485760">
<column name="CONTENT"/>
</property>
</class>
</hibernate-mapping>
the resulting SQL file is (notice the length of the blob field):
Code:
create table CONTENT_STREAM (id bigint generated by default as identity, CONTENT blob(255), primary key (id));
Thanks in advance for any help