ANY mapping ignores lazy="false"

Description

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

Environment

None

Assignee

Unassigned

Reporter

Manuel Dominguez Sarmiento

Fix versions

None

Labels

backPortable

None

Suitable for new contributors

None

Requires Release Note

Affirmative

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure