Hi,
I use session.find("From DataSource").
I get one SQL statement to retrieve all datasource rows but then I get a different SQL select for each Institution linked to a datatource.
Do you know where it could come from ?
thank you,
Here is part of my mapping:
<class name="DataSource" table="codDataSource" mutable="false">
<id name="Id" >
<generator class="increment" />
</id>
<property name="Description" />
<property name="Code" />
<many-to-one name="Institution" column="InstitutionId"/>
</class>
<class name="StatefulEntity" table="tblStatefulEntity">
<id name="Id">
<generator class="sequence">
<param name="sequence">seqObject</param>
</generator>
</id>
<bag name="Aliases" lazy="false" cascade="all-delete-orphan" inverse="true">
<key column="StatefulEntityID" />
<one-to-many class="Alias" />
</bag>
<many-to-one name="StatefulEntityType" column="StatefulEntityTypeId"/>
</class>
<joined-subclass name="Institution" extends="StatefulEntity" table="tblInstitution">
<key column="Id"/>
<property name="Name" column="InstitutionName" />
<many-to-one name="Country" column="CountryID"/>
</joined-subclass>
<class name="Alias" table="tblAlias">
<id name="Id">
<generator class="increment" />
</id>
<many-to-one name="AliasType" column="AliasTypeID"/>
<many-to-one name="StatefulEntity" column="StatefulEntityID"/>
<many-to-one name="DataSource" column="DataSourceID"/>
<property name="Value" column="Alias"/>
</class>
Last edited by antho on Mon Apr 03, 2006 5:24 pm, edited 1 time in total.
|