private string GetJoinTypeString(APSqlJoinType joinType) { if (joinType == APSqlJoinType.Inner) { return("INNER JOIN"); } else if (joinType == APSqlJoinType.Left) { return("LEFT JOIN"); } else if (joinType == APSqlJoinType.Right) { return("RIGHT JOIN"); } else if (joinType == APSqlJoinType.Full) { return("FULL JOIN"); } else if (joinType == APSqlJoinType.Cross) { return("CROSS JOIN"); } // default is inner join return("INNER JOIN"); }
/// <summary> /// Create a 'FROM' phrase. /// </summary> /// <param name="tableDef">Table definition.</param> /// <param name="joinType">SQL 'JOIN' type.</param> /// <param name="joinOnPhrase">SQL 'JOIN' condition.</param> public APSqlFromPhrase(APTableDef tableDef, APSqlJoinType joinType, APSqlWherePhrase joinOnPhrase) { if (tableDef == null) throw new ArgumentNullException("tableDef"); _tableDef = tableDef; _joinType = joinType; _joinOnPhrase = joinOnPhrase; }
/// <summary> /// Create a 'FROM' phrase. /// </summary> /// <param name="tableDef">Table definition.</param> /// <param name="joinType">SQL 'JOIN' type.</param> /// <param name="joinOnPhrase">SQL 'JOIN' condition.</param> public APSqlFromPhrase(APTableDef tableDef, APSqlJoinType joinType, APSqlWherePhrase joinOnPhrase) { if (tableDef == null) { throw new ArgumentNullException("tableDef"); } _tableDef = tableDef; _joinType = joinType; _joinOnPhrase = joinOnPhrase; }
/// <summary> /// Create a new LookupAPRptColumn. /// </summary> /// <param name="selectExpr">SQL 'SELECT' Expression.</param> /// <param name="id">Column unique ID.</param> /// <param name="title">Title.</param> /// <param name="joinTable">Join Table.</param> /// <param name="joinType">Join Type.</param> /// <param name="relationDef">Relation define.</param> /// <param name="relationShowColumn">Show relation column.</param> public LookupAPRptColumn(APSqlOperateExpr selectExpr, string id, string title, APTableDef joinTable, APSqlJoinType joinType, APRelationDef relationDef, APRptColumn relationShowColumn) : base(selectExpr, id, title) { _joinTable = joinTable; _joinType = joinType; _relationDef = relationDef; _relationShowColumn = relationShowColumn; }
/// <summary> /// Create 'JOIN' phrase. /// </summary> /// <param name="tableDef">The table defined.</param> /// <param name="joinType">Join Type.</param> /// <param name="wherePhrase">Join 'ON' phrase.</param> /// <returns>A 'FROM' phrase.</returns> public static APSqlFromPhrase Join(this APTableDef tableDef, APSqlJoinType joinType, APSqlWherePhrase wherePhrase) { return(new APSqlFromPhrase(tableDef, joinType, wherePhrase)); }
/// <summary> /// Create 'JOIN' phrase. /// </summary> /// <param name="tableDef">The table defined.</param> /// <param name="joinType">Join Type.</param> /// <param name="wherePhrase">Join 'ON' phrase.</param> /// <returns>A 'FROM' phrase.</returns> public static APSqlFromPhrase Join(this APTableDef tableDef, APSqlJoinType joinType, APSqlWherePhrase wherePhrase) { return new APSqlFromPhrase(tableDef, joinType, wherePhrase); }
private string GetJoinTypeString(APSqlJoinType joinType) { if (joinType == APSqlJoinType.Inner) return "INNER JOIN"; else if (joinType == APSqlJoinType.Left) return "LEFT JOIN"; else if (joinType == APSqlJoinType.Right) return "RIGHT JOIN"; else if (joinType == APSqlJoinType.Full) return "FULL JOIN"; else if (joinType == APSqlJoinType.Cross) return "CROSS JOIN"; // default is inner join return "INNER JOIN"; }