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

Sanne Grinovero sanne at hibernate.org
Thu Oct 24 05:55:42 EDT 2013


Good to know, thanks for the clarification.

In that case I don't know if the feature is important, it sounds like
it could be useful in some case but maybe it's far fetched in
practice.
I'll defer to opinion of other users.

Sanne

On 23 October 2013 00:03, Steve Ebersole <steve at hibernate.org> wrote:
> Gail is correct.  extra-lazy is something else completely.
>
> On Oct 22, 2013 4:00 PM, "Gail Badner" <gbadner at redhat.com> wrote:
>>
>> 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
>> >
>> _______________________________________________
>> 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