[hibernate-issues] [Hibernate-JIRA] Created: (HHH-3574) ANY mapping ignores lazy="false"

Manuel Dominguez Sarmiento (JIRA) noreply at atlassian.com
Thu Oct 30 08:24:04 EDT 2008


ANY mapping ignores lazy="false"
--------------------------------

                 Key: HHH-3574
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3574
             Project: Hibernate Core
          Issue Type: Bug
          Components: core
    Affects Versions: 3.3.1
            Reporter: Manuel Dominguez Sarmiento


We have a use case for eager fetching of an <any> association. The DTD accepts lazy="false|true", however at runtime it doesn't make any difference.

Digging deeper, we see that org.hibernate.mapping.Any does not have a lazy property, furthermore, it does not extend Fetchable. This explains why it will not work as expected.

There are two possible resolutions:
1) Implement eager fetching for <any> associations, unless there is some technical difficulty in doing so. Of course lazy fetching won't be possible using joins because of the nature of this type of associations, however it should be simple enough with a second select. This means that the XML config should handle lazy="false|true" but not fetch="join|select|subselect|etc"
2) Fix the DTD in case this can't be done to avoid confusion (less desirable).

-- 
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