示例#1
0
        public virtual string SerializeSelectTableJoin(SQLSelectTableJoin table)
        {
            string strSQL = SerializeSelectTableBase(table.LeftTable) + " " + SerializeTableJoinType(table.TheType) + " " + SerializeSelectTableBase(table.RightTable);

            var conditions = table.Where;

            if (conditions != null && !conditions.IsEmpty)
                strSQL += " ON " + SerializeSelectTableJoinConditions(conditions);

            //Surround the join with parentheses - MS Access won't accept it otherwise
            return "(" + strSQL + ")";
        }
示例#2
0
 private static string SerializeTableJoinType(SQLSelectTableJoin.Type joinType)
 {
     switch (joinType)
     {
         case SQLSelectTableJoin.Type.Inner:
             return "INNER JOIN";
         case SQLSelectTableJoin.Type.FullOuter:
             return "FULL OUTER JOIN";
         case SQLSelectTableJoin.Type.LeftOuter:
             return "LEFT OUTER JOIN";
         case SQLSelectTableJoin.Type.RightOuter:
             return "RIGHT OUTER JOIN";
         default:
             throw new NotImplementedException(joinType.ToString());
     }
 }