you have a good point.. i always use the old doctor/patient for
mapping relationships but this time it didn't quite cut it :)  In the
actual business case we have a Project, a User and a Role type, so the
intermediary table /mapping class is required.  would this change how
the other two destinations are defined?

i.e. Bob is a manager for Project Abc
Bob is a developer for Project abc
Jim is an architect for Project abc
Jim is an architect for Project xyz

I have been playing with the lazy attribute in both hibernate and
fdms... i find that leaving the hibernate generated stuff alone and
playing just with the fdms setting is working for me right now.  I
really like the delayed fetch stuff, however trapping the pending item
error took me a while to get my head around.

-Vic


--- In flexcoders@yahoogroups.com, "Jeff Vroom" <[EMAIL PROTECTED]> wrote:
>
> 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 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/flexcoders/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to