|
From: Andrei A. (JIRA) <nh...@gm...> - 2011-05-20 21:20:36
|
[ http://216.121.112.228/browse/NH-2404?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21138#action_21138 ]
Andrei Alecu commented on NH-2404:
----------------------------------
Think it was NH2690 :)
> Future queries crash (MultiQuery) when using projection queries using hql + result transformer or the linq provider (which compiles into hql)
> ----------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: NH-2404
> URL: http://216.121.112.228/browse/NH-2404
> Project: NHibernate
> Issue Type: Bug
> Components: Core
> Affects Versions: 3.0.0.Beta2, 3.0.0.CR1
> Reporter: Olli Ryhänen
> Priority: Major
> Fix For: 3.2.0Beta1
>
> Attachments: NH2404_Test.patch
>
>
> Using HQL query to create a projection and then choosing a result transformer to it crashes when using .Future<DTO> method to turn it into a multi-query query with exception:
> System.ArgumentException: The value "System.Object[]" is not of type "DTO" and cannot be used in this generic collection.
> The same is true when using the new .ToFuture<DTO>() support added for the linq provider and it crashes in the same location of the multi-query implementation.
> Example code that works:
> var query = session.CreateQuery("select e.Id as EntityId, e.Name as EntityName from TestEntity e")
> .SetResultTransformer(Transformers.AliasToBean(typeof (TestEntityDto)))
> .List<TestEntityDto>();
> Same query using future support causes the crash:
> var query = session.CreateQuery("select e.Id as EntityId, e.Name as EntityName from TestEntity e")
> .SetResultTransformer(Transformers.AliasToBean(typeof (TestEntityDto)))
> .Future<TestEntityDto>();
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|