I tried creating a custom ResultTransformer, but this path seems to
lead me into copying the data out of the proxy objects into their base
classes. I'm not sure how this performs, but I'll give it a try.

I'd really prefer not to have DTOs as they'd have to be identical to
the mapped classes. Can I actually use the same class as my DTO?

Is it really not possible to simply get a query to retrieve the mapped
classes without having to eager load everything (as opposed to
returning them as proxies)?

Alternatively, is it possible to implement my own proxy classes that
are basically the same as the base class? i.e. SomeClassProxy :
SomeClass {}

On 17 Mar., 22:00, Chucara <[email protected]> wrote:
> Fabio: I know you didn't say projections, but Ayende Rahien and Ben
> Lovell did.
>
> Sorry I wasn't clear in my first post. I do indeed want the relations,
> I just don't want to load them. Lazy loading does this, but this
> brings up the problem of LazyInitializationExceptions, which
> projection and DTOs seems to solve. I will try this tomorrow.
>
> Thanks to everyone for your help!
>
> On 17 Mar., 19:57, Fabio Maulo <[email protected]> wrote:
>
> > 2009/3/17 Tyler Burd <[email protected]>
>
> > > You might want to use projections and DTOs to get what you want.  Here is
> > > an example:
>
> > > string hql = "select u.Organization.Name, u.UserName from User u ";
> > > var qry = session.CreateQuery();
> > > qry.SetResultTransformer(new MyCustomDtoResultTransformer());
> > > return qry.List<MyCustomDto>();
>
> > And this mean work with relationship, have entities related and, in some
> > certain cases, retrieve only plain info in unmapped value-objects/DTO (Data
> > Transfer Object).
> > --
> > 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]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to