--- Dru Devore -------- Original Message -------- Subject: RE: Cascading relationships in ejb 3.0 From: "Sergio Samayoa" <sergiosamayoa_at_icon.com.gt> Date: Wed, February 27, 2008 11:29 am To: <persistence_at_glassfish.dev.java.net> AFAIK by default the details are loaded lazy. You can control this via annotations or declarative. Regards. _____ De: Dru Devore [ <mailto:ddevore_at_duckhouse.us%5d> mailto:ddevore_at_duckhouse.us] Enviado el: Miércoles, 27 de Febrero de 2008 10:18 a.m. Para: persistence_at_glassfish.dev.java.net Asunto: RE: Cascading relationships in ejb 3.0 I don't want to cascade the initial loading of the data. Let me explain a little. I have a deep table structure, 4 tables deep right now, we are currently designing the application and I don't want to load the whole structure when I load the top table. Basically I only want to go one deep upon a load but if I find that I need the next level then I want to load it for only that child. If I do the onetomany/manytoone for each of these relationships all of them will be loaded. I have considered making a set of beans for each level but that just seems like a lot of work I would rather avoid. Is there a simple way of telling the entities to ignore relationships unless explicitely told to load them? --- Dru Devore -------- Original Message -------- Subject: Re: Cascading relationships in ejb 3.0 From: James Sutherland <jamesssss_at_yahoo.com> Date: Wed, February 27, 2008 9:08 am To: persistence_at_glassfish.dev.java.net What operation cascading are you referring to? (merge, persist, remove) In general if you do not always want to cascade, then do not set the cascade on the relationship. Instead just perform the cascading operation in your application. i.e. call merge/persist/remove on the desired related entities. You may also be able to perform some sort of selective cascading through events. ddevore wrote: > > I have a situation where there are cascading relationships that I need to > make entity beans for. The problem is that if we are looking at any one > element we will only want that one element s child at any one time. Is > there a way I can turn off cascading beyond a certain level? --- Dru > Devore > > ----- --- <http://wiki.eclipse.org/User:James.sutherland.oracle.com> http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland <http://www.eclipse.org/eclipselink/> http://www.eclipse.org/eclipselink/ EclipseLink , <http://www.oracle.com/technology/products/ias/toplink/> http://www.oracle.com/technology/products/ias/toplink/ TopLink Wiki: <http://en.wikibooks.org/wiki/Java_Persistence> http://en.wikibooks.org/wiki/Java_Persistence Java Persistence , <http://wiki.eclipse.org/EclipseLink> http://wiki.eclipse.org/EclipseLink EclipseLink , <http://wiki.oracle.com/page/TopLink> http://wiki.oracle.com/page/TopLink TopLink Forums: <http://forums.oracle.com/forums/forum.jspa?forumID=48> http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink , <http://www.nabble.com/EclipseLink-f26430.html> http://www.nabble.com/EclipseLink-f26430.html EclipseLink -- View this message in context: <http://www.nabble.com/Cascading-relationships-in-ejb-3.0-tp15695945p1571395 6.html> http://www.nabble.com/Cascading-relationships-in-ejb-3.0-tp15695945p15713956 .html Sent from the java.net - glassfish persistence mailing list archive at Nabble.com.
(image/jpeg attachment: image001.jpg)
(image/jpeg attachment: image002.jpg)