[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-5187) Allow some control over whether or not an association is loaded via a join on the merge path

Dirk (JIRA) noreply at atlassian.com
Fri May 7 17:40:49 EDT 2010


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

Dirk commented on HHH-5187:
---------------------------

I followed your discussion on this topic.

"<epbernard> it all boils down to why this dud set the colelciton on LAZY while cascading MERGE"

No dud. It all boils down to why you need to eagerly load an uninitialized collection on merge. @OneToMany(mappedBy = "master", cascade={CascadeType.MERGE, CascadeType.PERSIST}) should not be a problem but in your current implementation it is because CascadeType.MERGE forces it to load the collection though it was lazy. Me and many other users thought Hibernate JPA would ignore the CascadeType.MERGE in this case because (1) propagation of state makes no sense for a proxied collection and (2) it is against the spec. 

"<sebersole> i think it comes down to (1) do we violate the spec (i've 
seen nothing that says we do here)
[11:31] <epbernard> sebersole: no clearly we don't violate the spec
[11:31] <sebersole> (2) if not, do we "violate the spirit" by loading 
association
[11:31] <sebersole> and if so (a) do we do so for valid reasons
[11:32] <epbernard> and yes we violate in the spirit but as you said for good 
underlying reasons
[11:32] <sebersole> ok"

That is the funniest part. You are kidding yourselves. You might have good reasons for your "violation in spirit" but honestly - it is not according to the spec.

So I do not think it is an user error in any way as you mentioned it. It is more driven by your design which enforces you to think about introducing a new mapping.. Any idea why EclipseLink does not need it!?  



> Allow some control over whether or not an association is loaded via a join on the merge path
> --------------------------------------------------------------------------------------------
>
>                 Key: HHH-5187
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5187
>             Project: Hibernate Core
>          Issue Type: New Feature
>          Components: core
>            Reporter: Emmanuel Bernard
>


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list