Yeah I know, but still, it's kind of strange that the default
AliasToBean transformer doesn't support other that strict public
constructors.
Actually I thought that one of the primary goals for NH was to provide
transparent persistence with close to no restrictions on the domain
model. Now I _have_ to provide a parameterless public constructor,
even though it's never user by anything by NH...

On 12 Mar., 14:37, Fabio Maulo <[email protected]> wrote:
> You can implement your own ResultTrasformer and use it.If you want work with
> all entities without a public 
> constructorhttp://fabiomaulo.blogspot.com/2008/11/entities-behavior-injection.html
>
> 2009/3/12 TigerShark <[email protected]>
>
>
>
>
>
> > Hi there
>
> > Just noticed a somewhat weird issue. When I'm transforming my queried
> > object to another type, the target type must have a public
> > constructor. Why is that?
>
> > I normally use small DTO's for lists etc. and don't want to expose a
> > public constructor on these kind of objects, as they only serve as
> > binding objects for the interface and therefore shouldn't be able to
> > be constructed outside that scope.
>
> > Looking at the NH source I came across this in
> > AliasToBeanTransformer.TransformTuple:
>
> > result = Activator.CreateInstance(this.resultClass);
>
> > This calls the activator and tells it to only create instances with
> > public constructors (nonPublic = false). Seems a bit strange to me...
>
> --
> 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