NHibernate : Mapping a custom sql query to an entity
This is a simple one. Just add .AddEntity to the ISqlQuery.
E.g.
var query = session.CreateSQLQuery("select * from posts");
query.AddEntity(typeof(Post));
IList posts = query.List();
Also if the Entity Post is not NHibernate mapped.
Use ResultTransformer like
query.SetResultTransformer(Transformers.AliasToBean