Usually you would not have a docpatients destination unless you needed to store additional info on that mapping (like the date the doctor acquired that patient).   Usually the docpatient table only has the doctor-id and patient-id and nothing else.  If it has other info, then you might need the extra Java object and then an extra destination to model the “mapping class”.   Assuming you don’t need the mapping object,  if doctor has a “patients” property and patient has a “doctors” property it should look like:

 

 For destination doctor:

 

    <many-to-many property=”patients” destination=”app.medical.patient” lazy=”true”/>

 

For destination patient:

 

   <many-to-many property=”doctors” destination=”app.medical.doctor” lazy=”true”/>

 

The choice as to whether you use lazy=”true” or false on FDMS is independent of whether you use lazy=true/false in hibernate (note that hibernate defaults to lazy=”true” but FDMS defaults the other way around).  Hibernate’s lazy property controls how objects are fetched from SQL, FDMS controls how the client fetches objects from the server.   I recommend starting off with lazy=”true” and then turning it to false when you find you need the performance or if the “ItemPendingErrors” cause you problems on the client when you try to fetch an item which is not loaded.

 

Jeff

 


From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of passive_thoughts
Sent: Monday, September 25, 2006 4:11 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] many-to-many destinations help

 

Can anyone provide an example of what the metadata section of my
destinations should look like in a many-to-many scenario?

3 tables: patient, doctor, doctorpatient

patient can have many doctors, doctor can have many patients.

I'd like to implement lazy loading as well, only calling up doctors on
a patient when user requests it, as well as the reverse.

Here's my guess...

for destination patient:
<many-to-many property="docpatient"
destination="app.medical.docpatient" lazy="false"/>

for destination doctor:
<many-to-many property="docpatient"
destination="app.medical.docpatient" lazy="false"/>

for destination docpatient (do i need this?):
<many-to-one property="patient" destination="app.medical.patient"
lazy="false"/>
<many-to-one property="doctor" destination="app.medical.doctor"
lazy="false"/>

My mind is fried. Please help.

Vic

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to