@IndexColumn + EagerFetch results in HibernateException
-------------------------------------------------------
Key: HHH-5309
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5309
Project: Hibernate Core
Issue Type: Bug
Affects Versions: 3.5.1
Reporter: Douglas Ferguson
If you query an entity that has a list with (@IndexColumn and Eager) and this list is
empty there is an Exception.
It appears that the code is verifying that the index column it not null, but in this case
the index column is null because the left join will bring back a null because the list
empty...
The stack Trace:
org.hibernate.HibernateException:null index column for collection:
<<EntityClass>>
org.hibernate.persister.collection.AbstractCollectionPersister.readIndex(AbstractCollectionPersister.java:771)
org.hibernate.collection.PersistentList.readFrom(PersistentList.java:402)
org.hibernate.loader.Loader.readCollectionElement(Loader.java:1052)
org.hibernate.loader.Loader.readCollectionElements(Loader.java:690)
org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:630)
org.hibernate.loader.Loader.doQuery(Loader.java:745)
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:270)
org.hibernate.loader.Loader.doList(Loader.java:2294)
org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2172)
org.hibernate.loader.Loader.list(Loader.java:2167)
org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:119)
org.hibernate.impl.SessionImpl.list(SessionImpl.java:1706)
org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:347)
--
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....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira