Nhibernate documentation refers to CriteriaUtil whitch is removed from 2.1

Description

http://nhforge.org/doc/nh/en/index.html#querycriteria-associations

In chapter 14.4. Associations:

Note that the kittens collections held by the Cat instances returned by the previous two queries are not pre-filtered by the criteria! If you wish to retrieve just the kittens that match the criteria, you must use SetResultTransformer(CriteriaUtil.AliasToEntityMap).

IList cats = sess.CreateCriteria(typeof(Cat))
.CreateCriteria("Kittens", "kt")
.Add( Expression.Eq("Name", "F%") )
.SetResultTransformer(CriteriaUtil.AliasToEntityMap)
.List();
foreach ( IDictionary map in cats )
{
Cat cat = (Cat) map[CriteriaUtil.RootAlias];
Cat kitten = (Cat) map["kt"];
}

Environment

None

Activity

Fixed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

Who's Looking?

Open Who's Looking?
Created March 1, 2010 at 6:29 AM
Updated December 4, 2010 at 3:37 PM
Resolved July 21, 2010 at 1:47 PM
Who's Looking?