|
From: xelibrion (JIRA) <nh...@gm...> - 2011-05-01 15:06:55
|
[ http://216.121.112.228/browse/NH-2624?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=20988#action_20988 ]
xelibrion commented on NH-2624:
-------------------------------
Okay, thank you for this information
> MultiCriteria does not work with criteria created using JoinQueryOver
> ---------------------------------------------------------------------
>
> Key: NH-2624
> URL: http://216.121.112.228/browse/NH-2624
> Project: NHibernate
> Issue Type: Bug
> Components: Core
> Affects Versions: 3.1.0
> Reporter: xelibrion
> Assignee: Richard Brown
> Priority: Minor
>
> I've got exception
> System.InvalidCastException: Unable to cast object of type 'Subcriteria' to type 'NHibernate.Impl.CriteriaImpl'.
> at NHibernate.Impl.MultiCriteriaImpl.CreateCriteriaLoaders() in d:\CSharp\NH\NH\nhibernate\src\NHibernate\Impl\MultiCriteriaImpl.cs:line 287
> at NHibernate.Impl.MultiCriteriaImpl.List() in d:\CSharp\NH\NH\nhibernate\src\NHibernate\Impl\MultiCriteriaImpl.cs:line 73
> in code
> var queryOver = Session.QueryOver<Post>()
> .Fetch(x => x.Author).Eager
> .Fetch(x => x.Blog).Eager
> .JoinQueryOver(x => x.SearchRequests)
> .Where(x => x.Id == context.SearchRequestId)
> .TransformUsing(Transformers.DistinctRootEntity)
> .Skip(context.PageIndex*pageSize)
> .Take(pageSize);
> Session.CreateMultiCriteria()
> .Add(queryOver.UnderlyingCriteria)
> .Add(queryOver.ToRowCountQuery().UnderlyingCriteria)
> .List();
> I've found workaround using JoinAlias
--
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
|