-->
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: lost links between objects in entity model
PostPosted: Fri May 11, 2007 5:58 am 
Newbie

Joined: Fri May 11, 2007 5:19 am
Posts: 2
hi, every one,
first of all, thanks those gays who make Hibernate tools, which let code generation into a rush job.

here is my question:

i create 3 tables in MySql(sample DB of middlengen), "persons", "airlines", "reservations",
one-many between "persons" and "reservation", one-many between "airlines" and "reservation".

i get perfect result when i create the project in Eclipse3 for the first time, three objects and two links, but after i regenerate the hbm.xmls and POJOs, i lost the links.

part of the map file look like this:

<hibernate-mapping>
<class name="Reservations" table="reservations" catalog="airline">
<comment></comment>
<composite-id name="id" class="ReservationsId">
<key-property name="reservationId" type="int">
<column name="reservation_id" />
</key-property>
<key-property name="personIdFk" type="int">
<column name="person_id_fk" />
</key-property>
<key-property name="flightIdFk" type="int">
<column name="flight_id_fk" />
</key-property>
</composite-id>
<property name="registrationUtc" type="timestamp">
<column name="registration_utc" length="0" not-null="true">
<comment></comment>
</column>
</property>
<property name="comment" type="string">
<column name="comment" length="65535">
<comment></comment>
</column>
</property>
</class>
</hibernate-mapping>

why? is there an option there?


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 11, 2007 12:07 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
your database or driver does not have nor report the foreign keys correctly to hibernate.

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