I use hibernate3 tool to reverse engineering my hsqlDB, it's so good,
but when I use hibernate console, there's one exception:
Code:
Problem while executing Create SessionFactory(org.hibernate.MappingException: Repeated column in mapping
for entity: com.me.app.model.FinanceDocumentItem column: FAMILY_ID
(should be mapped with insert="false" update="false"))
the "com.me.app.model.FinanceDocumentItem"'s hbm.xml is:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<!--
Auto-generated mapping file from
the hibernate.org cfg2hbm engine
-->
<class name="com.me.app.model.FinanceDocumentItem" table="FINANCE_DOCUMENT_ITEM">
<composite-id name="id" class="com.me.app.model.FinanceDocumentItemId">
<key-many-to-one name="FinanceDocument" class="com.me.app.model.FinanceDocument">
<column name="FAMILY_ID" scale="32" precision="0" not-null="false" />
<column name="ORG_ID" scale="32" precision="0" not-null="false" />
<column name="ACCOUNT_NO" scale="32" precision="0" not-null="false" />
<column name="SUBACCOUNT_NO" scale="32" precision="0" not-null="false" />
<column name="FINANCE_DOCUMENT_NO" scale="32" precision="0" not-null="false" />
<column name="FINANCE_YEAR" scale="0" precision="0" not-null="false" />
</key-many-to-one>
<key-many-to-one name="AccountDocumentItem" class="com.me.app.model.AccountDocumentItem">
<column name="FAMILY_ID" scale="32" precision="0" not-null="false" />
<column name="FINANCE_YEAR" scale="0" precision="0" not-null="false" />
<column name="DOCUMENT_NO" scale="32" precision="0" not-null="false" />
<column name="SN" scale="0" precision="0" not-null="false" />
</key-many-to-one>
</composite-id>
</class>
</hibernate-mapping>
how can I resolve this problem? thank you very much!