[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-3414) fetch profiles

Sebastien Tardif (JIRA) noreply at atlassian.com
Wed Dec 28 08:17:19 EST 2011


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-3414?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44754#comment-44754 ] 

Sebastien Tardif commented on HHH-3414:
---------------------------------------

It's hard to write complex software without this feature. I'm used to software that nobody understand more than 30% of the use cases, and the workflows then to make an infinite set of different calls against the domain objects and DAO. I'm surprise this is still not yet fixed, and how the user are able to cope without it.

http://webspherepersistence.blogspot.com/2009/02/dynamic-fetch-planning.html
http://openjpa.apache.org/builds/latest/docs/manual/ref_guide_fetch.html

Other similar framework still didn't code that yet: https://bugs.eclipse.org/bugs/show_bug.cgi?id=310817 & https://bugs.eclipse.org/bugs/show_bug.cgi?id=305020





> fetch profiles
> --------------
>
>                 Key: HHH-3414
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3414
>             Project: Hibernate Core
>          Issue Type: New Feature
>          Components: core, metamodel
>            Reporter: Steve Ebersole
>            Assignee: Steve Ebersole
>
> The concept of fetch profiles as we are discussing here is basically to allow users to dynamically affect the mapped fetching strategy for associations at runtime.
> Consider the following example:
> <class name="Person">
>     ...
>     <set name="addresses" lazy="true" fetch="subselect" ...>
>         ...
>     </set>
> </class>
> <class name="Address">
>     ...
> </class>
> This follows the normal recommendation to map associations as lazy and use a dynamic fetching strategy (ala HQL/Criteria) to modify this lazy behavior at runtime.
> The fetaure discussed here would allow the same behavior for loading as well:
> <hibernate-mapping>
>     <fetch-profile name="person-details">
>         <fetch path="Person.addresses" style="join"/>
>     </fetch-profile>
> </hibernate-mapping>
> Or:
> <hibernate-mapping>
> <class name="Person">
>     ...
>     <fetch-profile name="person-details">
>         <fetch path="addresses" style="join"/>
>     </fetch-profile>
>     <set name="addresses" lazy="true" fetch="subselect" ...>
>         ...
>     </set>
> </class>
> </hibernate-mapping>
> Now, doing:
> session.enableFetchProfile( "person-details" ).get( Person.class, 1 )...
> will load Person#1 as well as their addresses in a single joined query.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list