With nHibernate, what happends when you want to return an object that doesn't map to a table/entity?
views:
26answers:
1
Q:
with nHibernate, what happends when you want to return an object that doesn't map to a table/entity?
A:
As long as it's based off of data in the database, but not necessarily your business entities, you can use a projection.
http://japikse.blogspot.com/2009/02/using-projections-and-transformers-in.html
http://elegantcode.com/2007/10/30/nhibernate-projections/
Daniel Auger
2009-06-09 01:49:17
To clarify this answer, you can project aggregate values based off of mapped properties, but you can't arbitrarily select unmapped columns without dropping back to SQL.
Stuart Childs
2009-06-09 13:10:18