Thanks a lot for quick response - I'll take a look in both options. On Thu, Apr 15, 2010 at 3:50 PM, Fabio Maulo <[email protected]> wrote:
> opt1 > mutable="false" polymorphism="explicit" > <loader> with named query for load > > opt2: > ResultTransformer > > 2010/4/15 Filip Kinsky <[email protected]> > >> I'd like to divide domain model classes and query-only classes in my >> application. I'd use model classes for write operations and query >> classes for reading data. Now I'm struggling with mapping of a query >> class which should have flattened some of the properties. My classes >> look something like: >> >> class User >> { >> public long Id; >> public string Name; >> public Role Role; >> } >> >> class UserQueryItem >> { >> public long Id; >> public string Name; >> public long RoleId; >> public string RoleName; >> } >> >> Now I'm trying to map both classes against same DB tables and make >> queries like "from UserQueryItem where RoleName = 'admin'" possible. >> It's quite easy to map the UserQueryItem class using some hidden Role >> property which would fill RoleId + RoleName fields in its setter, but >> I'm not able to figure out how to enable queries against flattened >> RoleId and RoleName fields. Is it possible to achieve this somehow? I >> know I could query using Role.Id or Role.Name with alias, but this is >> not a solution for me at the moment. >> >> -- >> 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]<nhusers%[email protected]> >> . >> For more options, visit this group at >> http://groups.google.com/group/nhusers?hl=en. >> >> > > > -- > Fabio Maulo > > -- > 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]<nhusers%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/nhusers?hl=en. > -- 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.
