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