public CriteriaJoinWalker(IOuterJoinLoadable persister,CriteriaQueryTranslator translator, ISessionFactoryImplementor factory, CriteriaImpl criteria, string rootEntityName, IDictionary<string, IFilter> enabledFilters) : base(translator.RootSQLAlias, persister, factory, enabledFilters) { this.translator = translator; querySpaces = translator.GetQuerySpaces(); if (translator.HasProjection) { resultTypes = translator.ProjectedTypes; InitProjection( translator.GetSelect(enabledFilters), translator.GetWhereCondition(enabledFilters), translator.GetOrderBy(), translator.GetGroupBy().ToString(), LockMode.None ); } else { resultTypes = new IType[] {TypeFactory.ManyToOne(persister.EntityName)}; InitAll(translator.GetWhereCondition(enabledFilters), translator.GetOrderBy(), LockMode.None); } userAliasList.Add(criteria.Alias); //root entity comes *last* userAliases = ArrayHelper.ToStringArray(userAliasList); }
public CriteriaJoinWalker(IOuterJoinLoadable persister, CriteriaQueryTranslator translator, ISessionFactoryImplementor factory, ICriteria criteria, string rootEntityName, IDictionary <string, IFilter> enabledFilters) : base(translator.RootSQLAlias, persister, factory, enabledFilters) { this.translator = translator; querySpaces = translator.GetQuerySpaces(); if (translator.HasProjection) { resultTypes = translator.ProjectedTypes; InitProjection( translator.GetSelect(enabledFilters), translator.GetWhereCondition(enabledFilters), translator.GetOrderBy(), translator.GetGroupBy(), translator.GetHavingCondition(enabledFilters), enabledFilters, LockMode.None); } else { resultTypes = new IType[] { TypeFactory.ManyToOne(persister.EntityName) }; InitAll(translator.GetWhereCondition(enabledFilters), translator.GetOrderBy(), LockMode.None); } userAliasList.Add(criteria.Alias); //root entity comes *last* userAliases = userAliasList.ToArray(); }
public CriteriaJoinWalker(IOuterJoinLoadable persister, CriteriaQueryTranslator translator, ISessionFactoryImplementor factory, ICriteria criteria, string rootEntityName, IDictionary <string, IFilter> enabledFilters) : base(translator.RootSQLAlias, persister, factory, enabledFilters) { this.translator = translator; querySpaces = translator.GetQuerySpaces(); if (translator.HasProjection) { InitProjection( translator.GetSelect(), translator.GetWhereCondition(), translator.GetOrderBy(), translator.GetGroupBy(), translator.GetHavingCondition(), enabledFilters, LockMode.None, translator.GetEntityProjections()); resultTypes = translator.ProjectedTypes; userAliases = translator.ProjectedAliases; includeInResultRow = new bool[resultTypes.Length]; ArrayHelper.Fill(IncludeInResultRow, true); } else { InitAll(translator.GetWhereCondition(), translator.GetOrderBy(), LockMode.None); resultTypes = new IType[] { TypeFactory.ManyToOne(persister.EntityName) }; // root entity comes last userAliasList.Add(criteria.Alias); //root entity comes *last* resultTypeList.Add(translator.ResultType(criteria)); includeInResultRowList.Add(true); userAliases = userAliasList.ToArray(); resultTypes = resultTypeList.ToArray(); includeInResultRow = includeInResultRowList.ToArray(); } }
public CriteriaJoinWalker(IOuterJoinLoadable persister, CriteriaQueryTranslator translator, ISessionFactoryImplementor factory, ICriteria criteria, string rootEntityName, IDictionary<string, IFilter> enabledFilters) : base(translator.RootSQLAlias, persister, factory, enabledFilters) { this.translator = translator; querySpaces = translator.GetQuerySpaces(); if (translator.HasProjection) { InitProjection( translator.GetSelect(enabledFilters), translator.GetWhereCondition(enabledFilters), translator.GetOrderBy(), translator.GetGroupBy(), translator.GetHavingCondition(enabledFilters), enabledFilters, LockMode.None); resultTypes = translator.ProjectedTypes; userAliases = translator.ProjectedAliases; includeInResultRow = new bool[resultTypes.Length]; ArrayHelper.Fill(IncludeInResultRow, true); } else { InitAll(translator.GetWhereCondition(enabledFilters), translator.GetOrderBy(), LockMode.None); resultTypes = new IType[] { TypeFactory.ManyToOne(persister.EntityName) }; // root entity comes last userAliasList.Add(criteria.Alias); //root entity comes *last* resultTypeList.Add(translator.ResultType(criteria)); includeInResultRowList.Add(true); userAliases = userAliasList.ToArray(); resultTypes = resultTypeList.ToArray(); includeInResultRow = includeInResultRowList.ToArray(); } }
protected void InitProjection(CriteriaQueryTranslator translator, IDictionary<string, IFilter> enabledFilters, LockMode lockMode) { // the order of the calls here is important, as the join clauses can contain parameter bindings SqlString projectionString = translator.GetSelect(enabledFilters); WalkEntityTree(persister, Alias); SqlString whereString = translator.GetWhereCondition(enabledFilters); SqlString orderByString = translator.GetOrderBy(); SqlString groupByString = translator.GetGroupBy(); SqlString havingString = translator.GetHavingCondition(enabledFilters); Persisters = new ILoadable[0]; InitStatementString(projectionString, whereString, orderByString, groupByString.ToString(), havingString, lockMode); }