NHibernate - get List<long> representing primary keys?
Posted
by Nathan
on Stack Overflow
See other posts from Stack Overflow
or by Nathan
Published on 2010-05-03T23:19:00Z
Indexed on
2010/05/03
23:28 UTC
Read the original article
Hit count: 266
nhibernate
|orm
I have a situation where I definitely don't want to get the whole domain object. Basically, the entity has a primary key of long (.NET)/bigint(sql server 2005). I simply need to pass the primary key to an external system which will access the database directly - and since the list of ids could be large, I don't want to rehydrate the entire domain object just to get the Id.
In linq2sql, I could accomplish this with a projection, but I am restricted to NHibernate 1.2.1.4000, which doesn't support Linq.
Is there a way to accomplish this using NHibernate 1.2.1.4000?
(I am open to using a named-query if that will work)
© Stack Overflow or respective owner