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: NHibernate 2.0.0.Alpha1 join element with property-ref bug?
PostPosted: Fri Apr 04, 2008 5:39 pm 
Newbie

Joined: Fri Apr 04, 2008 5:10 pm
Posts: 2
Hibernate version: 2.0.0.Alpha1

Mapping documents:

Code:
<class name="Person" table="`Person`">
      <id name="PersonId" column="personId" type="int" unsaved-value="0">
         <generator class="identity"/>
      </id>
      <version name="LastModifiedDate" type="Timestamp" column="`lastModifiedDate`" />
      <property name="FirstName" column="`firstName`" length="300" not-null="true"/>
      <property name="LastName" column="`lastName`" length="300" not-null="true"/>
      <property name="MiddleName" column="`middleName`" length="300" not-null="false"/>
      <property name="ContactInformationOwnershipTypeId" column="`contactInformationOwnershipTypeId`" type="int" not-null="true"/>
      <property name="ContactInformationId" column="`contactInformationId`" type="int" not-null="true" />
      <join table="`ContactInformation`" fetch="join">
         <key property-ref="ContactInformationId" column="`contactInformationId`"/>
         <property name="EmailAddress" column="`emailAddress`" length="255" not-null="false"/>
         <property name="PreferredMethodOfContact" column="`preferredMethodOfContactId`" not-null="true" />
      </join>
   </class>



Name and version of the database you are using: SQL Server 2005

The generated SQL:
Code:
select person0_.personId as x0_0_ from [Person] person0_ inner join [ContactInformation] person0_1_ on person0_.personId=person0_1_.[contactInformationId] where (person0_.[lastName]=@p0 )and(person0_.[firstName]=@p1 )


Should be SQL:
Code:
select person0_.personId as x0_0_ from [Person] person0_ inner join [ContactInformation] person0_1_ on person0_.[contactInformationId]=person0_1_.[contactInformationId] where (person0_.[lastName]=@p0 )and(person0_.[firstName]=@p1 )


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 27, 2008 11:15 am 
Newbie

Joined: Fri Apr 04, 2008 5:10 pm
Posts: 2
I took a look at the unit tests and none of the test cases test this scenario. Is this planned to be supported?


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.