Cloning subcriteria loses WithClause
Description
Environment
None
Attachments
1
- 06 Apr 2011, 09:05 AM
Activity
Show:
Fabio Maulo July 30, 2011 at 2:11 PM
Closed after final release of NH3.2.0GA
Fixed
Details
Details
Assignee
Unassigned
UnassignedReporter
Vitaliy Litovskiy
Vitaliy LitovskiyComponents
Fix versions
Affects versions
Priority
Who's Looking?
Open Who's Looking?
Created April 6, 2011 at 9:05 AM
Updated July 30, 2011 at 2:11 PM
Resolved April 7, 2011 at 10:00 PM
Who's Looking?
Method CloneSubcriteria in Subcriteria class doesn't clone the original WithClause.
steps to reproduce in pseudo code:
var criteria = DetachedCriteria.For<Model>();
criteria.AddAlias("Collection", "item", JoinType.LeftOuterJoin, Restrictions.Eq("item.Property", "somve value"))
var cloneCriteria = CriteriaTransformer.Clone(criteria);
As a result criteria and cloneCriteria will return different results. This is cause by additional ON conditions for JOIN are lost in the SQL.
It seems that i've found how to fix the issue, but i haven't set up the development environment yet and cant build NHibernate solution and run tests. The possible patch is attached.