I've a recursive relationship table below. The problem is that the
PARENT_ID column allows null value but the generated code in the
BaseTopic.java does not allow me to set null value. One way to work around
this problem is using the Criteria object. I am wandering if there are
other ways to do it?
<table name="HTG_TOPIC" idMethod="idbroker" javaName="Topic">
<column name="TOPIC_ID" required="true" primaryKey="true"
type="INTEGER"/>
<column name="TOPIC_NAME" required="true" type="VARCHAR"
size="99" javaName="Name"/>
<column name="PARENT_ID" type="INTEGER"></column>
<unique>
<unique-column name="TOPIC_NAME"/>
</unique>
<foreign-key foreignTable="HTG_TOPIC">
<reference local="PARENT_ID" foreign="TOPIC_ID"/>
</foreign-key>
</table>
Thanks