Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: Build 1.2.0.GA
Mapping documents:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="QuickQuote" namespace="QuickQuote">
<class name="FestoonTrolleyMain" table="[Festoon Trolley Main]">
<id name="Uid" column="UID" type="integer">
<generator class="assigned">
</generator>
</id>
<property column="[FestoonType Id]" type="integer" name="FestoonTypeId" />
<property column="TrolleyStyle" type="integer" name="TrolleyStyle" />
<property column="ClampType" type="string" name="ClampType" />
<property column="CableType" type="integer" name="CableType" />
<many-to-one name="DefinitionId" column="[Definition Id]" class="FestoonTrolleyDefinition" />
</class>
</hibernate-mapping>
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="QuickQuote" namespace="QuickQuote">
<class name="FestoonTrolleyDefinition" table="[Festoon Trolley Definition]">
<id name="DefinitionId" column="DefinitionId" type="integer">
<generator class="assigned">
</generator>
</id>
<bag name="FestoonTrolleyMainList" inverse="true" lazy="true">
<key column="Definition Id" />
<one-to-many class="FestoonTrolleyMain" />
</bag>
<property column="CorrosionResistant" type="boolean" name="CorrosionResistant" />
<property column="SparkResistant" type="boolean" name="SparkResistant" />
<property column="IsDefault" type="boolean" name="IsDefault" />
<property column="DescriptionId" type="integer" name="DescriptionId" />
<property column="Diameter" type="Single" name="Diameter" />
<property column="ClampWidth" type="Single" name="ClampWidth" />
<property column="ClampHeight" type="Single" name="ClampHeight" />
<property column="Length" type="Single" name="Length" />
<property column="Height" type="Single" name="Height" />
<property column="Width" type="Single" name="Width" />
<property column="TrolleyUnits" type="string" name="TrolleyUnits" />
<property column="Weight" type="Single" name="Weight" />
<property column="WeightUnit" type="string" name="WeightUnit" />
<property column="SingleClampAdd" type="Single" name="SingleClampAdd" />
<property column="BumperLength" type="Single" name="BumperLength" />
<property column="ParentSize" type="short" name="ParentSize" />
<property column="AddOnHeight" type="short" name="AddOnHeight" />
<property column="PictureLeftOffset" type="integer" name="PictureLeftOffset" />
<property column="RGIncluded" type="boolean" name="RgIncluded" />
</class>
</hibernate-mapping>
SQL.Append("FROM FestoonTrolleyMain as Main ")
SQL.Append("left outer join Main.DefinitionId as Definition ")
SQL.Append("WHERE Main.FestoonTypeId = :FestoonType")
query = session.CreateQuery(SQL.ToString)
Query.List() produces a list of arrays.
0 - is type FestoonTrolleyMain
1 - is type FestoonTrolleyDefinition
Is there a way I can do a .list(of X)
Because on other (non-joined) tables, I like the ability to .List(ClassType) and have the list come back as a typed list