This is probably something stupid I have missed but why does this happen?
I've got the id of my parent class setup like this:
Code:
<class name="com.lehman.mis.model.AccountProfile" table="ACCOUNT_PROFILE">
<id name="id" type="integer">
<column name="ID" sql-type="numeric(10,0)"/>
<generator class="identity"/>
</id>
various properties....
<!-- Bi-directional one-to-many -->
<set name="clientAcronyms" cascade="all-delete-orphan" inverse="true">
<key column="PARENT_ID""/>
<one-to-many class="com.lehman.mis.model.ClientAcronyms"/>
</set>
<set name="budgetsAndCoverages" cascade="all-delete-orphan" inverse="true">
<key column="PARENT_ID"/>
<one-to-many class="com.lehman.mis.model.BudgetAndCoverage"/>
</set>
And one of the child classes like this:
Code:
<class name="com.lehman.mis.model.BudgetAndCoverage" table="ACCOUNT_BUDGET_AND_COVERAGE">
<id name="id" type="integer">
<column name="ID" sql-type="numeric(10,0)"/>
<generator class="identity"/>
</id>
<!-- A bi-drectional mapping. A BudgetAndCoverage can't live without a Account Profile. -->
<many-to-one name="parent" class="com.lehman.mis.model.AccountProfile" column="PARENT_ID" not-null="true"/>
And SchemaExport keeps insisting on generating INT for PARENT_ID in the children classes...
Shouldn't this be the same sql-type (numeric(10, 0)) ? My database thinks so...
I can't find a way to force Hibernate to generate the correct type since sql-type is not applicable to the key attribute in the set tag.
Or am I missing something trivial?
/Jonas