-->
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: Telling hibernate not to enforce foreign keys.
PostPosted: Thu Aug 31, 2006 4:29 pm 
Newbie

Joined: Thu Aug 31, 2006 3:56 am
Posts: 2
This question is related to my previous one (one-to-many mapping with multiple parents), but takes a different approach. Is there any way to tell hibernate not to generate a foreign key constraint (using hbm2ddl.auto) between these two tables. While one seems to exist in this mapping, I don't want the database constraint there.

The docs imply that this foreign key is implicit to the relationship between the parent class and its collection, but I'm wondering if there's just a way to "turn off" the constraint generation (just for this relationship). Thanks.

Hibernate version: 3.1 rc2

Mapping documents:
Code:
<class name="Parent" table="PARENTS">
   <id name="guid" column="PARENT_ID"/>
   <property name="name" column="NAME"/>
   <set name="childSet"
           table="CHILDREN"
           lazy="false"
           cascade="save-updae,persist">
         <key column="CHILD_ID"/>
         <one-to-many class="Child"/>
   </set>
</class>


Code between sessionFactory.openSession() and session.close():
session.save(new Parent("Fred"));

Name and version of the database you are using:
HSQL


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.