Issue Type: Bug Bug
Affects Versions: 4.1.7
Assignee: Unassigned
Attachments: Activity.hbm.xml, Assignee.hbm.xml, hibernate.cfg.xml, OneToManyTest.java, Subtask.hbm.xml, Task.hbm.xml
Components: query-hql
Created: 22/Apr/13 4:31 AM
Description:

Trying to fetch a List<Map<String, Object>> using the following query causes a LazyInitializationException.

select distinct root from _testCatalog_Task root inner join fetch root.subtasks subs left join fetch subs.activities

This exception only occurs when the nested association is a one-to-many association and the entities are fetched as a Map.
Mapping Pojos to the hibernate mappings defined in the hbm.xml files and using those as a result resolves this bug, but i have to use Map representation.
I have also found out that the following query will give me the result that i would expect from the first query:

select distinct root from _testCatalog_Task root inner join fetch root.subtasks subs left join subs.activities

So using lazy fetching on the nested one-To-Many association 'subs.activities' works as i would expect it from eager fetching.

Project: Hibernate ORM
Priority: Major Major
Reporter: Matthias Sattel
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira