This has got to be trivial but I'm not coming across the answer. I
have a ICriteria query that I build that has several joins by invoking
subsequence CreateCriterias...
.CreateCriteria(typeof(PublicationType))
.CreateCriteria
(PublicationTypeMetaData.Associations.PrivilegePublicationTypes)
.CreateCriteria
(PrivilegePublicationTypeMetaData.Associations.PrivilegePublicationTypeUserTypes)
.CreateCriteria
(PrivilegePublicationTypeUserTypeMetaData.Associations.UserType)
.CreateCriteria(UserTypeMetaData.Associations.Users)
.CreateCriteria
(UserMetaData.Associations.CompanyUsers)
.Add(Expression.Eq
(CompanyUserMetaData.Associations.User, user))
.Add(Expression.Eq
(CompanyUserMetaData.Associations.Company, company))
.List<PublicationType>();
Basically, all i want to get back is an IList<PublicationType> without
having the query select EVERY column from all the tables back. I
really only want a small handful of columns and for obvious
performance reasons, want this to happen on the SQL backend, not in
my .NET app.
If I do ProjectionList().Add then its not wanting to run properly as
it is expecting a Object[] rather than PublicationType for the result
and my preference would be to get all the columns of a certain table
implicitly.
(note: the XxxMetaData.Associations.Xyz are simply static readonly
strings for my association paths. Please don't let this be a point of
confusion)
Could someone give me a hand with this? Thanks in advance.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---