-->
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: Composite keys - appears more than once in the result column
PostPosted: Tue Dec 04, 2007 4:49 am 
Newbie

Joined: Tue Dec 04, 2007 4:41 am
Posts: 1
Hibernate version:
1.2.0.GA

I have the same problems that were described here: http://jira.nhibernate.org/browse/NH-343

I have one table with composite key:

Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
   <class name="Core.Domain.CatalogObject, Core" table="dbo.[CatalogObject]" lazy="false">

      <composite-id access="field">
          <key-property name="CatalogObjectId" column="CatalogObjectId" type="Int32" />
          <key-property name="CultureId" column="CultureId" type="Int32" />
         
      </composite-id>
      
      <many-to-one name="CatalogObjectType" column="CatalogObjectTypeId" class="Core.Domain.CatalogObjectType, Core" />
      <property column="Name" type="String" name="Name" not-null="true" length="100" />
      
   </class>
</hibernate-mapping>


and another referencing to it with more than 1 FK:

Code:
      <many-to-one name="TransportationDocumentsType" class="Core.Domain.CatalogObject, Core">
         <column name="TransportationDocumentsTypeId" />
         <column name="CultureId" />
      </many-to-one>
      <many-to-one name="CarType" class="Core.Domain.CatalogObject, Core">
         <column name="CarTypeId" />
         <column name="CultureId" />
      </many-to-one>


nHibernate generates query with N CultureId inserts. Why NH-343 is closed? Is there walk around or it is unimportant? :)


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.