From: Andrei A. (JIRA) <nh...@gm...> - 2011-05-23 17:43:52
|
[ http://216.121.112.228/browse/NH-2328?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21159#action_21159 ] Andrei Alecu commented on NH-2328: ---------------------------------- Ok, since I was pressed on time, I ended up with the following workaround which works: public static class GetTypeFullNameExtension { public static string GetTypeFullName(this object what) { return what.GetType().FullName; } } public class TypeIsGenerator : BaseHqlGeneratorForMethod { public TypeIsGenerator() { this.SupportedMethods = new[] { ReflectionHelper.GetMethodDefinition<object>(x => x.GetTypeFullName()) }; } public override HqlTreeNode BuildHql( MethodInfo method, Expression targetObject, ReadOnlyCollection<Expression> arguments, HqlTreeBuilder treeBuilder, IHqlExpressionVisitor visitor) { return treeBuilder.Dot(visitor.Visit(arguments[0]).AsExpression(), treeBuilder.Class()); } } After merging the generator in, I can now run this query: var boxes = (from t in s.Query<ToyBox>() where t.Shape.GetTypeFullName() == typeof(Square).FullName select t).ToList(); Which is sufficient for us for now. > Linq query on <Any/> fails > -------------------------- > > Key: NH-2328 > URL: http://216.121.112.228/browse/NH-2328 > Project: NHibernate > Issue Type: Bug > Components: Linq Provider > Affects Versions: 3.0.0.Alpha2 > Reporter: Michael Kobaly > Priority: Major > Attachments: NHibernate.Test.zip > > > Please read NHUsers group posting here for description of problem. > http://groups.google.com/group/nhusers/browse_thread/thread/fa831bd703842e1e > I excluded the lib folder from the zip file since upload says not to include dlls. I am using NH 3 Alpha 2 with all supporting dlls. First time posting bug..sorry in advance if I am doing it wrong. -- 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 |