Hi,
I have solved my earlier problem with simple foreign key relationships
and they now work.
But how do I avoid loading the parent object before it is required?
I know I can use a single proxy for a whole collection BUT what is the
equivilent for single foreign key relationships like this
<class-descriptor
class="org.visres.contact.data.Country"
table="Countries"
>
<field-descriptor
name="countryId"
column="CountryId"
jdbc-type="INTEGER"
primarykey="true"
autoincrement="true"
sequence-name="GEN_CountryId"
/>
<field-descriptor
name="name"
column="Name"
jdbc-type="VARCHAR"
/>
</class-descriptor>
<class-descriptor
class="org.visres.contact.data.State"
table="States"
proxy="dynamic"
>
<field-descriptor
name="stateId"
column="StateId"
jdbc-type="INTEGER"
primarykey="true"
autoincrement="true"
sequence-name="GEN_StateId"
/>
<field-descriptor
name="name"
column="Name"
jdbc-type="VARCHAR"
/>
<field-descriptor
name="countryId"
column="CountryId"
jdbc-type="INTEGER"
/>
<reference-descriptor
name="country"
class-ref="org.visres.contact.data.Country"
>
<foreignkey field-ref="countryId"/>
</reference-descriptor>
</class-descriptor>
So when I load a State I don't want to load it's country unless I call
state.getCountry().
Thanks
Dave
--
David Warnock, Sundayta Ltd. http://www.sundayta.com
iDocSys for Document Management. VisibleResults for Fundraising.
Development and Hosting of Web Applications and Sites.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
- RE: How to do Lazy Foreign Keys? David Warnock
- RE: How to do Lazy Foreign Keys? Charles Anthony
- Re: How to do Lazy Foreign Keys? David Warnock
- RE: How to do Lazy Foreign Keys? Charles Anthony
