/// <summary>
 ///
 /// </summary>
 /// <param name="tableName"></param>
 /// <param name="alias"></param>
 /// <param name="concreteAlias"></param>
 /// <param name="fkColumns"></param>
 /// <param name="pkColumns"></param>
 /// <param name="joinType"></param>
 public void AddJoin(string tableName, string alias, string concreteAlias, string[] fkColumns, string[] pkColumns, JoinType joinType)
 {
     if (!useThetaStyleInnerJoins || joinType != JoinType.InnerJoin)
     {
         JoinFragment jf = dialect.CreateOuterJoinFragment();
         jf.AddJoin(tableName, alias, fkColumns, pkColumns, joinType);
         AddFragment(jf);
     }
     else
     {
         AddCrossJoin(tableName, alias);
         AddCondition(concreteAlias, fkColumns, pkColumns);
     }
 }
Пример #2
0
        /// <summary>
        /// Generate a sequence of <c>LEFT OUTER JOIN</c> clauses for the given associations.
        /// </summary>
        /// <param name="associations"></param>
        /// <returns></returns>
        protected JoinFragment MergeOuterJoins(IList associations)
        {
            JoinFragment outerjoin = dialect.CreateOuterJoinFragment();

            foreach (OuterJoinLoader.OuterJoinableAssociation oj in associations)
            {
                outerjoin.AddJoin(oj.TableName, oj.Subalias, oj.ForeignKeyColumns, oj.PrimaryKeyColumns, oj.JoinType);
                outerjoin.AddJoins(
                    oj.Joinable.FromJoinFragment(oj.Subalias, false, true),
                    oj.Joinable.WhereJoinFragment(oj.Subalias, false, true)
                    );
            }

            return(outerjoin);
        }