Exemplo n.º 1
0
 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");
 }
Exemplo n.º 2
0
		/// <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;
		}
Exemplo n.º 3
0
        /// <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;
        }
Exemplo n.º 4
0
 /// <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;
 }
Exemplo n.º 5
0
		/// <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;
		}
Exemplo n.º 6
0
 /// <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));
 }
Exemplo n.º 7
0
		/// <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);
		}
Exemplo n.º 8
0
		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";
		}