Re: [Hibernate] New laziness rules
On Tue, 03 May 2005 01:31:59 +0200, Gavin King <[EMAIL PROTECTED]> wrote: Yes, you're misunderstanding. If I say lazy="false", it should *always* be eager fetched. ok got it! Like it! But we need to make it *very* clear in the release notes. /max There's nothing wrong with fetch="join" lazy="true" if you want flexibility. -Original Message- From: Max Andersen Sent: Monday, 2 May 2005 5:48 PM To: Gavin King; Christian Bauer; hibernate-devel@lists.sourceforge.net Subject: Re: [Hibernate] New laziness rules Note that the association-level lazy setting is now *completely respected*. if I run a HQL query and some of the objects in the result set have non-lazy associations, those associations will be *immediately fetched*. This one I don't get why we want that ? I actually saw it as a strength that you via the HQL language could override what the static mapping specifiedor am i misunderstanding this ? -- -- Max Rydahl Andersen callto://max.rydahl.andersen Hibernate [EMAIL PROTECTED] http://hibernate.org JBoss Inc [EMAIL PROTECTED] http://jboss.com --- This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 ___ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] New laziness rules
On May 3, 2005, at 1:31 AM, Gavin King wrote: There's nothing wrong with fetch="join" lazy="true" if you want flexibility. I hate explaining this already... --- This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 ___ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel
RE: [Hibernate] New laziness rules
Yes, you're misunderstanding. If I say lazy="false", it should *always* be eager fetched. There's nothing wrong with fetch="join" lazy="true" if you want flexibility. -Original Message- From: Max Andersen Sent: Monday, 2 May 2005 5:48 PM To: Gavin King; Christian Bauer; hibernate-devel@lists.sourceforge.net Subject: Re: [Hibernate] New laziness rules >> Note that the association-level lazy setting is now *completely >> respected*. if I run a HQL query and some of the objects in the result > >> set have non-lazy associations, those associations will be >> *immediately fetched*. This one I don't get why we want that ? I actually saw it as a strength that you via the HQL language could override what the static mapping specifiedor am i misunderstanding this ? -- -- Max Rydahl Andersen callto://max.rydahl.andersen Hibernate [EMAIL PROTECTED] http://hibernate.org JBoss Inc [EMAIL PROTECTED] http://jboss.com --- This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r ___ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] New laziness rules
Note that the association-level lazy setting is now *completely respected*. if I run a HQL query and some of the objects in the result set have non-lazy associations, those associations will be *immediately fetched*. This one I don't get why we want that ? I actually saw it as a strength that you via the HQL language could override what the static mapping specifiedor am i misunderstanding this ? -- -- Max Rydahl Andersen callto://max.rydahl.andersen Hibernate [EMAIL PROTECTED] http://hibernate.org JBoss Inc [EMAIL PROTECTED] http://jboss.com --- This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 ___ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel
RE: [Hibernate] New laziness rules
OK, I ditched rule (2). Now they are completely orthogonal. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Christian Bauer Sent: Thursday, 28 April 2005 3:16 PM To: Subject: Re: [Hibernate] New laziness rules On Apr 28, 2005, at 7:26 PM, Gavin King wrote: > Only rule (2) is suspect. We don't need it, and I can get rid of it if > you guys like. I've added it because I think it might help reduce the > number of forum questions from people who wonder "why do I get lazy > fetching when fetch=join?". Not following the forums much, is that really a problem? > Note that the association-level lazy setting is now *completely > respected*. if I run a HQL query and some of the objects in the result > set have non-lazy associations, those associations will be > *immediately fetched*. Major change, has to be announced on homepage for 3.0.3 release. --- SF.Net email is sponsored by: Tell us your software development plans! Take this survey and enter to win a one-year sub to SourceForge.net Plus IDC's 2005 look-ahead and a copy of this survey Click here to start! http://www.idcswdc.com/cgi-bin/survey?id5hix ___ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel --- This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r ___ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] New laziness rules
On Apr 28, 2005, at 7:26 PM, Gavin King wrote: Only rule (2) is suspect. We don’t need it, and I can get rid of it if you guys like. I’ve added it because I think it might help reduce the number of forum questions from people who wonder “why do I get lazy fetching when fetch=join?”. Not following the forums much, is that really a problem? Note that the association-level lazy setting is now *completely respected*. if I run a HQL query and some of the objects in the result set have non-lazy associations, those associations will be *immediately fetched*. Major change, has to be announced on homepage for 3.0.3 release. --- SF.Net email is sponsored by: Tell us your software development plans! Take this survey and enter to win a one-year sub to SourceForge.net Plus IDC's 2005 look-ahead and a copy of this survey Click here to start! http://www.idcswdc.com/cgi-bin/survey?id5hix ___ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel
[Hibernate] New laziness rules
As you guys probably know, I have been doing a lot of thinking about how to orthogonalize the notion of eager/lazy from the notion of fetch strategy (the actual SQL). And I want to do this in a way which allows a good implementation of EJB3 fetching contract, and remains reasonably compatible with what we have today. Oh, and I want to also try and reduce the number of newbie forum posts. The basic concept is that association mappings have both: fetch attribute lazy attribute For single-valued associations: fetch = “select|join” lazy = “true|false|proxy” where lazy = “true” means use instvar interception, and lazy = “proxy” means use the proxy of the associated class (if it has one). For collection-valued associations: fetch = “select|join|subselect” lazy = “true|false” where lazy = “true” is the usual lazy collection fetching we know and love (or hate). For the second join of a many-to-many fetch = “select|join” lazy = “false|proxy” Note that this is a special case, since fetch = “join” is the default! So, here are the new rules: (1) if lazy is specified, use the specified laziness semantics (2) if lazy is not specified and fetch = “join”, assume lazy = “false” (3) if lazy is not specified and not fetch = “join” a. for collections, assume the default-lazy (almost always “true”) b. for single-valued associations, assume “proxy” Only rule (2) is suspect. We don’t need it, and I can get rid of it if you guys like. I’ve added it because I think it might help reduce the number of forum questions from people who wonder “why do I get lazy fetching when fetch=join?”. Note that the association-level lazy setting is now *completely respected*. if I run a HQL query and some of the objects in the result set have non-lazy associations, those associations will be *immediately fetched*.