-->
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.  [ 1 post ] 
Author Message
 Post subject: Reverse Eng Issue with hbm2hbmxml - need help resolving
PostPosted: Tue Oct 06, 2009 8:13 am 
Newbie

Joined: Tue Oct 06, 2009 4:09 am
Posts: 1
Hello,

I'm building hbm.xml files with a JDBC Configuration using hibernate tools, but facing a bunch of problems here.
Hope any can help with this.
1. Failing to take care of composite primary keys and Foreign keys
here in a particular table "account_details" [Primary key contains - (id, household_account_id,affiliate_scheme_id)] exporter fails due to an error saying -
Code:
                     `Foreign key (FK1419A630FE819854:account_details [household_account_id])) must have same number of columns as the referenced primary key (account_details [id,household_account_id,affiliate_scheme_id])`

on table account_details i have a FK - household_account_id referencing `player_id` (account_details)
ie.
    FOREIGN KEY (`household_account_id` )
    REFERENCES  `account_details` (`player_id` )
       

here the thing is i have unique indexes for the table which do not get mapped and then i would like to use this association with hibernate as this exists in multiple tables. Is there a way around this ? Can write hbm.xml files for such tables but I do not want to have to run the tool everytime i want to find out all the tables with problems. the schema is like pretty big here.

Also straightforward instances of FK's are getting mapped okay without any problems.
Details -
hibernate-3.2.6.ga
HibernateTools-3.2.4.GA
mysql-connector-java-5.1.10
java 1.6

from hibernate.cfg.xml -
Code:
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
        <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/zenfox</property>
        <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>


from ant task -
Code:
   
<hibernatetool destdir="${build.dir}">
       <jdbcconfiguration
         packagename="base"
         configurationfile="hibernate.cfg.xml"
         revengfile="hibernate.reveng.xml"
         detectmanytomany="true" />
         <!-- detectoptmisticlock="true" -->
        <hbm2hbmxml destdir="${build.dir}"/>
    </hibernatetool>


I'm sure this is a pretty common issue though oddly enough i found very few references to this, has anyone run across this before ?


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

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.