-->
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: Foreign Key Problem Creating DB with SQLServer
PostPosted: Wed Oct 13, 2004 3:59 pm 
Newbie

Joined: Tue Jun 08, 2004 8:07 pm
Posts: 14
Location: Washington, D.C.
am having some trouble switching over to MS SQL server with getting the tables created properly upon startup. It works with MySQL but blows up with SQLServer. Below are the details and I can certainly provide more detail if that'll help.

thanks

~harris


Hibernate version: 2.1.4

Mapping documents:

Mapping documents:
<hibernate-mapping>
<class name="electric.uddi.TModel" table="tmodels">
<id name="tModelKey" type="string" column="tmodel_key" access="field">
<generator class="assigned"/>
</id>
<property name="name" column="name" type="string"/>
<property name="authorizedName" column="authorizedName" type="string"/>
<property name="operator" column="operator" type="string"/>
<property name="userName" column="userName" type="string"/>
<property name="checked" column="checked" type="boolean"/>
<property name="hidden" column="hidden" type="boolean"/>
<property name="lastModified" column="lastModified" type="long"/>
<many-to-one name="overview" class="electric.uddi.Overview" column="overview_key" cascade="none" />
<array name="descriptions" table="descriptions">
<key column="description_key" foreign-key="tmodel_key"/>
<index column="description_index"/>
<composite-element class="electric.uddi.Description">
<property name="text" column="text" type="string"/>
<property name="language" column="language" type="string"/>
</composite-element>
</array>
<array name="identifiers" table="identifiers">
<key column="identifier_key" foreign-key="tmodel_key"/>
<index column="identifiers_index"/>
<composite-element class="electric.uddi.Identifier">
<property name="name" column="name" type="string"/>
<property name="value" column="value" type="string"/>
<property access="field" name="tModelKey" column="tModelKey" type="string"/>
</composite-element>
</array>
<array name="categories" table="categories">
<key column="category_key" foreign-key="tmodel_key"/>
<index column="categories_index"/>
<composite-element class="electric.uddi.Category">
<property name="name" column="name" type="string"/>
<property name="value" column="value" type="string"/>
<property access="field" name="tModelKey" column="tModelKey" type="string"/>
</composite-element>
</array>
</class>
</hibernate-mapping>


[Name and version of the database you are using: MS SQLServer 2000

Debug level Hibernate log excerpt:
Oct 13, 2004 2:16:12 PM net.sf.hibernate.tool.hbm2ddl.SchemaExport execute
SEVERE: Unsuccessful: alter table categories add constraint tmodel_key foreign k
ey (category_key) references tmodels



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.