A criteria query that uses with clauses on multiple joins can insert the values for the query parameters in the wrong order This only appears to affect joins that are added to the criteria in a different order than they appear in the POJO.
This appears to occur because CriteriaQueryTranslator, which adds the parameter values to the query, has a listing of the subcriteria in the order in which they were added to the criteria object and creates the list of parameter values based on that ordering, however, AbstractEntityJoinWalker initStatementString(), which adds the actual joins to the query string being generated, has a listing of the properties of the entity in the order in which they are enumerated in the actual entity object.
|