[hibernate-dev] Use cases for many-to-many collection of proxies?

Gail Badner gbadner at redhat.com
Tue Oct 22 17:00:29 EDT 2013


As far as I can tell, "extra-lazy" applies to the collection itself, not its elements. lazy="extra" is defined on <map>, <set>, <bag>, <idbag>, <list>. 

Currently, an extra-lazy collection can be configured having <many-to-many> with fetch="select" or outer-join="false". In the case of a map, doing a lookup by key would not initialize the map (because the map is extra-lazy) and it would return an uninitialized proxy for the value (because of the fetch="select" or outer-join="false"). 

Do you think that would have a real-world application?

Removing the fetch="select" or outer-join="false" functionality from <many-to-many> on an extra-lazy collection would not change the normal extra-lazy behavior, avoiding initialization of the collection itself.

Gail

----- Original Message -----
> From: "Sanne Grinovero" <sanne at hibernate.org>
> To: "Gail Badner" <gbadner at redhat.com>
> Cc: "hibernate-dev" <hibernate-dev at lists.jboss.org>
> Sent: Monday, October 21, 2013 4:47:58 PM
> Subject: Re: [hibernate-dev] Use cases for many-to-many collection of proxies?
> 
> Hi Gail,
> does this impact as well the "extra-lazy" collections?
> I definitely had great use cases for them in the past.
> 
> On 21 October 2013 19:22, Gail Badner <gbadner at redhat.com> wrote:
> > Are there real-world use cases where an initialized many-to-many collection
> > should contain elements that are uninitialized proxies (HibernateProxy),
> > rather than entity instances?
> >
> > Currently, it is possible to configure this behavior using either:
> >
> > <many-to-many ... fetch="select"/>
> > <many-to-many ... outer-join="false"/>
> >
> > We are considering removing this capability if there are no real-world use
> > cases.
> >
> > Fetch profiles do not provide this level of granularity. The fetch style
> > for the collection itself, but not its elements, can be configured using a
> > fetch profile.
> >
> > As far as I know, JPA does not provide this level of granularity either.
> >
> > Please let us know if you are using this functionality.
> >
> > Thanks,
> > Gail
> > _______________________________________________
> > hibernate-dev mailing list
> > hibernate-dev at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/hibernate-dev
> 


More information about the hibernate-dev mailing list