criteria loader runs into ArrayIndexOutOfBoundsException caused by wrong condition
handling for column span zero
----------------------------------------------------------------------------------------------------------------
Key: HHH-5919
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5919
Project: Hibernate Core
Issue Type: Bug
Affects Versions: 3.6.1, 3.5.4, 3.3.2, 3.2.7, 3.1.2, 3.0.5
Reporter: Christoph Weißenborn
Attachments: org.hibernate.loader.criteria.criterialoader.patch
Retriving results from a query with a last column with zero column span we run into
ArrayOutOfBoundsException.
An easy fix:
org.hibernate.loader.criteria.CriteriaLoader (revision 20078) method
getResultColumnOrRow(Object[], ResultTransformer, ResultSet, SessionImplementor)
In line 143 condition ">" should change to "!=". The variable pos
is not a valid index for columnAlias when numColumns (=column span) is 0.
ArrayHelper.slice handles condition numColumns zero correctly.
Alternative workaround:
Change how the query is built. The last column should be at another position in the
query.
--
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