-->
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: System.Array from .List()
PostPosted: Fri Dec 14, 2007 3:31 pm 
Newbie

Joined: Fri Dec 14, 2007 3:20 pm
Posts: 8
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


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.