criteria loader runs into ArrayIndexOutOfBoundsException caused by wrong condition handling for column span zero

Description

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.

Attachments

1

Activity

Duplicate

Details

Assignee

Reporter

Original estimate

Time tracking

No time logged0.5h remaining

Priority

Created February 11, 2011 at 6:05 PM
Updated December 19, 2013 at 9:25 PM
Resolved December 19, 2013 at 9:25 PM