OK, I tried the @hibernate.column tag to no avail. Maybe I am using a version of xdoclet that is too old? I am using the version that comes with maven (1.2b2).
Anyway, I did try putting the length field on the @hibernate.properties tag again like so:
Code:
@hibernate.property column="state" type="XXXStateType" length="20"
This did seem to modify the generated .hbm.xml file as shown below:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping.dtd">
<hibernate-mapping>
<class
name="XXXDomainObject"
table="xxx_domain_object"
>
<id
name="id"
column="id"
>
<generator class="uuid.hex">
</generator>
</id>
<property
name="displayName"
type="java.lang.String"
column="display_name"
not-null="false"
unique="false"
/>
<property
name="state"
type="XXXStateType"
column="state"
length="20"
not-null="false"
unique="false"
/>
</class>
</hibernate-mapping>
Note that the length attribute on the property element is set to 20. However, when I try to export the schema, this is produced:
Code:
drop table xxx_domain_object
create table xxx_domain_object (
id VARCHAR(255) not null,
display_name VARCHAR(255),
state CHAR(1),
primary key (id)
)
It still appears to want to set the state field to "CHAR(1)". Any ideas?