when you select a subset of an entity you are creating a projection.
projections do not allow parent/child aggregations with a single query. You
could use futures instead which will issue 2 select statements in a single
remote call.
var names = session.CreateQuery("select FirstName, LastName from Person
where id in(:ids)").setparamenter("ids", ids).Future<object[]>();
var addresses = session.CreateQuery("select City, Street from Address where
Person_id in(:pids)").setparamenter("pids", ids).Future<object[]>();
//build up name/address object.
while that works, it would be much easier to
var peoplewithaddresses = session.CreateQuery("from Person p join fetch
p.Address where p.id in (:ids)").setparameter("ids", ids).Future<Person>();
//project the names and address to a dto
the extra columns will not cause a preformance problem.
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en.