Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Mapping Question

Hi Roger,

Is there a relationship between a child and its parent? Most of the time, a parent will have a OneToMany with a child, and the child will have a ManyToOne relationship back. Mark the @ManyToOne relationship as lazy - as well as all other relationships that you might not want to always load.
Best Regards,
Chris

Roger wrote:
On Thursday 24 September 2009 19:57:58 christopher delahunt wrote:

Other than increasing the memory and the heap, you can make some of the
backward relationships also lazy - specifically the ManyToOne back
pointers.  This will prevent the entire tree from being inadvertently
brought into memory when not needed.

Is there a different annotation needed on the @OneToMany backpointer as I have already tried that. and EclipseLInk still walked back up the tree.

You can also look at where a
relationship is not strictly needed and unmap them - bringing them in
using a query instead when they are needed.  For instance, in a
ManyToMany, it may not be necessary to have both sides mapped if the
application will only ever us it from one side.


That looks like the quickest solution. I will try that in the morning temporarily to get my job done, but I would like to get to the bottom of what's going on and to be able to have some degree of control over back-
walking - if it's possible.

Regards
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users


Back to the top