-->
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: jdbcconfiguration and very poor reverse-engineering
PostPosted: Fri Jan 18, 2008 10:51 am 
Newbie

Joined: Fri Mar 23, 2007 4:47 am
Posts: 16
Hi All

I am having a problem when generating hbm files according to a database structure. Hibernate calls it 'hibernate-reverse-engineering'

I have 2 tables TEST and TEST_1. Table TEST has a foreign key to table TEST_1. When I execute the following:

Code:
<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="projectClassPath" />

<hibernatetool destdir="generated/src">
   <jdbcconfiguration configurationfile="hibernate.cfg.xml" revengfile="hibernate.reveng.xml" />
   <hbm2java jdk5="true" ejb3="false" />
</hibernatetool>


I get an error org.hibernate.MappingException: An association from the table TEST refers to an unmapped class Test_1

If I update my hibernate.reveng.xml file so that the TEST_1 table is reverse engineered first then things work fine. It seams if you have a table TEST with a foreign key to another table TEST_1 then TEST table is analyzed first causing the error to be thrown because TEST_1 isnt mapped yet.

I beleive this to be a bug. If the mapping doesnt exist yet then jdbcconfiguration should create the missing mapping first then continue.

Anybody else got this problem?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 18, 2008 1:21 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
please show the full stacktrace.

And if a file is generated then show that file too please.

_________________
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.