Result transformer that allows to transform a result to a user specified class which will be populated via setter methods or fields matching the alias names.

Namespace: NHibernate.Transform
Assembly:   NHibernate (in NHibernate)
Version: 1.2.0.4000

Syntax

Visual Basic (Declaration)
<SerializableAttribute> _
Public Class AliasToBeanResultTransformer _
	Implements IResultTransformer
C#
[SerializableAttribute]
public class AliasToBeanResultTransformer : IResultTransformer
Visual C++
[SerializableAttribute]
public ref class AliasToBeanResultTransformer : IResultTransformer

Examples

CopyC#
IList resultWithAliasedBean = s.CreateCriteria(typeof(Enrollment))
            .CreateAlias("Student", "st")
            .CreateAlias("Course", "co")
            .SetProjection( Projections.ProjectionList()
                    .Add( Projections.Property("co.Description"), "CourseDescription" )
            )
            .SetResultTransformer( new AliasToBeanResultTransformer(typeof(StudentDTO)) )
            .List();

StudentDTO dto = (StudentDTO)resultWithAliasedBean[0];

Inheritance Hierarchy

System.Object
  NHibernate.Transform.AliasToBeanResultTransformer