Hi all
We are trying to fix the ID field to char(32) instead of varchar(32). Table creation is done via SchemaUpdate and we are using MySQL.
------------------------------------------------------------------------------
This mapping,
<hibernate-mapping>
<class name="foo" table="FOO">
<id name="id">
<column name="ID" sql-type="char(32)" not-null="true"/>
<generator class="assigned"/>
</id>
<property name="content">
<column name="CONTENT" sql-type="varchar(255)"/>
</property>
</class>
</hibernate-mapping>
generates
FOO {
ID varchar(32),
CONTENT varchar(255)
}
Even if I have specifically asked for char(32).
------------------------------------------------------------------------------
However, by fixing the content type to char(255),
<hibernate-mapping>
<class name="foo" table="FOO">
<id name="id">
<column name="ID" sql-type="char(32)" not-null="true"/>
<generator class="assigned"/>
</id>
<property name="content">
<column name="CONTENT" sql-type="char(255)"/>
</property>
</class>
</hibernate-mapping>
I am able to generate table as
FOO {
ID char(32),
CONTENT char(255)
}
But we need content to be of type varchar.
In other words, SchemaUpdate will not create the id type as char() if there are other varchar() fields present. Is this understanding correct?
Cheers
-Wee King-
|