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 )