You can use CreateSQLQuery with formulas.
Here is a proof of concept. Display (class is not difficult to guess):
<class name="Foo"> <id name="Id"> <generator class="hilo"/> </id> <property name="Data"/> <property name="DataX2" formula="Data * 2"/> </class>
And here is the request:
var foos = session.CreateSQLQuery( @" select Id as {foo.Id}, Data as {foo.Data}, Data + Data as {foo.Data2} from Foo ") .AddEntity("foo", typeof(Foo)) .List<Foo>();
If you look carefully, you will see that I am using a different formula than the one indicated in the comparison. NHibernate allows anything as long as all properties are in the request.
I suggest you read 17.1.2. Entity queries and the following items.
Diego mijelshon
source share