public object TranslateExpression(Expression expression) { if (_Log.IsDebugEnabled) _Log.DebugFormat("Translating expression: {0}", expression); expression = Evaluator.PartialEval(expression); expression = new BinaryBooleanReducer().Visit(expression); var addedAlias = new Dictionary<string, IList<string>>(); expression = new AssociationVisitor((ISessionFactoryImplementor)session.SessionFactory, addedAlias).Visit(expression); expression = new InheritanceVisitor().Visit(expression); expression = CollectionAliasVisitor.AssignCollectionAccessAliases(expression); expression = new PropertyToMethodVisitor().Visit(expression); expression = new BinaryExpressionOrderer().Visit(expression); if (_Log.IsDebugEnabled) _Log.DebugFormat("Optimized expression: {0}", expression); var translator = new NHibernateQueryTranslator(session, entityName); return this.rootCriteria == null ? translator.Translate(expression, this.queryOptions) : translator.Translate(expression, (ICriteria)this.rootCriteria.Clone()); }
public object TranslateExpression(Expression expression) { expression = Evaluator.PartialEval(expression); expression = new BinaryBooleanReducer().Visit(expression); expression = new AssociationVisitor((ISessionFactoryImplementor)session.SessionFactory).Visit(expression); expression = new InheritanceVisitor().Visit(expression); expression = CollectionAliasVisitor.AssignCollectionAccessAliases(expression); expression = new PropertyToMethodVisitor().Visit(expression); expression = new BinaryExpressionOrderer().Visit(expression); var translator = new NHibernateQueryTranslator(session, entityName); return this.rootCriteria == null ? translator.Translate(expression, this.queryOptions) : translator.Translate(expression, (ICriteria)this.rootCriteria.Clone()); }