At first glance, it looks like a bug to me.

If you can attach the test case to a new Jira that would be great.
On 24 Aug 2011 20:29, "Neo" <[email protected]> wrote:
> I was testing some things out using the QueryOver API and stumbled
> upon the following after simplifying it down:
>
> take an entity like this:
> public class Student {
> public virtual int Id { get; protected set; }
> public virtual string Name { get; set; }
> }
>
> if I do:
>
session.QueryOver<Student>().TransformUsing(Transformers.AliasToEntityMap).List();
> it will throw an exception saying something like:
> "The value "System.Collections.Hashtable" is not of type
> "NHibernateLab.Models.Student" and cannot be used in this generic
> collection. Parameter name: value"
>
> the very same call but using criteria api:
>
session.CreateCriteria<Student>().SetResultTransformer(Transformers.AliasToEntityMap).List();
> will work just fine.
>
> so I tested doing:
>
session.QueryOver<Student>().TransformUsing(Transformers.AliasToEntityMap).UnderlyingCriteria.List();
> which actually will work just fine.
>
> Is this a bug, or what's up with that?
> And,yes I know this call doesn't make much sense in this case, but
> this was as far as I could simplify it and still get it to throw an
> exception, it wasn't the original use case.
>
> Cheers,
> Ted
>
> --
> 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.
>

-- 
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