I found other way to do the same thing...
The solution is select in named query the properties from diferents entities that I want, and then in the execute method I configure the "SetResultTransformer" in IQuery:
public IList ExecuteCustomQuery(string queryName, string[] parameterNames, object[] parameterValues, Type resultType)
{
AliasToBeanConstructorResultTransformer res = new AliasToBeanConstructorResultTransformer(resultType.GetConstructors()[0]);
IQuery query = NHibernateSession.GetNamedQuery(queryName).SetResultTransformer(res);
|