-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: how can I resolve this problem when using Hibernate3 Tool
PostPosted: Thu Mar 31, 2005 3:34 pm 
Newbie

Joined: Thu Mar 31, 2005 3:10 pm
Posts: 2
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!


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 01, 2005 2:52 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
it seems you have a two foreign keys that includes the same column. I dont think we handle that case yet.

please add an entry in jira for this with the simplest sql ddl (create table etc.) for it if you can.

thank you

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.