-->
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: Reverse engineer - foreign-keys issues
PostPosted: Wed Jul 29, 2009 4:42 pm 
Newbie

Joined: Wed Jul 29, 2009 4:24 pm
Posts: 1
I am attempting to generate mapping files for my SQL Server 2005 database. When I do so, I do not get any foreign-keys in the xml file. when I include the hbm file in the build, maven complains that the hbm file is missing the foreign-key tag. When I manually insert a foreign-key constraint - it works fine.

Is there a way to FORCE hibernate tools to generate the tag? For example, PolicyTypeID should have a foreign-key constraint on it.

Here is example of my file:

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated Jun 22, 2009 3:31:46 PM by Hibernate Tools 3.2.4.GA -->
<hibernate-mapping>
<class name="com.novell.zenworks.datamodel.objects.zesm.Policy" table="Policy" schema="dbo">
<id name="policyId" type="int">
<column name="PolicyID" />
<generator class="assigned" />
</id>
<many-to-one name="policyType" class="com.novell.zenworks.datamodel.objects.zesm.PolicyType" fetch="select">
<column name="PolicyTypeID" not-null="true" />
</many-to-one>
<property name="name" type="string">
<column name="Name" length="100" not-null="true" />
</property>
<property name="description" type="string">
<column name="Description" length="500" not-null="true" />
</property>
......


Top
 Profile  
 
 Post subject: Re: Reverse engineer - foreign-keys issues
PostPosted: Sun Aug 02, 2009 10:15 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
huh ? what foreign-key tag is it you want ?

And we just generate foreign-key constraints based on what you specified in hte mappings.

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