示例#1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="queryJoinType">Query join type</param>
 /// <param name="tableName">Table name</param>
 /// <param name="alias">Alias</param>
 /// <param name="queryConditions">Query condition list</param>
 public QueryJoin(QueryJoinType queryJoinType, string tableName, string alias, IEnumerable <QueryCondition> queryConditions)
 {
     // Initializtaion.
     QueryJoinType   = queryJoinType;
     QueryConditions = queryConditions;
     TableName       = tableName;
     Alias           = alias;
 }
示例#2
0
 public QueryJoin(
     string tableName,
     QueryJoinType joinType,
     string[] joinConditions)
     : this()
 {
     this.TableName = tableName;
     this.JoinType  = joinType;
     this.JoinConditions.AddRange(joinConditions);
 }
        public static Bitmap GetImage(this QueryJoinType type)
        {
            switch (type)
            {
            case QueryJoinType.Left: return(CoreIcons.leftjoin);

            case QueryJoinType.Right: return(CoreIcons.rightjoin);

            case QueryJoinType.Inner: return(CoreIcons.innerjoin);

            case QueryJoinType.Full: return(CoreIcons.fulljoin);
            }
            throw new Exception();
        }
        public static string GetSqlName(this QueryJoinType type)
        {
            switch (type)
            {
            case QueryJoinType.Left: return("LEFT JOIN");

            case QueryJoinType.Right: return("RIGHT JOIN");

            case QueryJoinType.Inner: return("INNER JOIN");

            case QueryJoinType.Full: return("OUTER JOIN");
            }
            throw new Exception();
        }
示例#5
0
 public static IQueryJoin EntityType(Type from, Type to, QueryJoinType joinType)
 {
     return(EntityType(from, to, null, joinType, null));
 }
示例#6
0
 public static IQueryJoin EntityType <T, TU>(String alias, QueryJoinType joinType)
 {
     return(EntityType(typeof(T), typeof(TU), null, joinType, alias));
 }
示例#7
0
 public static IQueryJoin EntityType <T, TU>(QueryJoinType joinType)
 {
     return(EntityType(typeof(T), typeof(TU), null, joinType, null));
 }
示例#8
0
		/// <summary>
		/// Complex join, joining two table elements on a complex join condition.
		/// </summary>
		public Join(TableElement TableElement1, TableElement TableElement2, QueryJoinType JoinType, Q JoinCondition)
		{
			Init(TableElement1);
			this.TableElement1 = TableElement1;
			this.TableElement2 = TableElement2;
			this.JoinCondition = JoinCondition;
			this.JoinType = JoinType;
		}
 public void SwitchFullJoin()
 {
     m_joinType = QueryJoinType.Full;
     Invalidate();
 }
示例#10
0
 public void SwitchLeftJoin()
 {
     m_joinType = QueryJoinType.Left;
     Invalidate();
 }
示例#11
0
		/// <summary>
		/// Complex join, joining two table elements on a complex join condition.
		/// </summary>
		public Join(object Element1, object Element2, QueryJoinType JoinType, Q JoinCondition)
		{
			TableElement TableElement1, TableElement2;

			if (Element1 is TableElement)
				TableElement1 = (TableElement)Element1;
			else
				TableElement1 = new TableElement(Element1);

			if (Element2 is TableElement)
				TableElement2 = (TableElement)Element2;
			else
				TableElement2 = new TableElement(Element2);

			Init(TableElement1);
			this.TableElement1 = TableElement1;
			this.TableElement2 = TableElement2;
			if (Element1 is TableElement || Element2 is TableElement)
				this.JoinCondition = JoinCondition;
			else
				this.JoinCondition = new And(new Q(Element1, Element2, true), JoinCondition);

			this.JoinType = JoinType;
		}
示例#12
0
 // RPD-1454: MySql does not support full joins
 public override bool IsSupported(QueryJoinType joinType)
 {
     return(joinType.IsOneOf(QueryJoinType.Inner, QueryJoinType.Left, QueryJoinType.Right));
 }
 /// <summary>
 /// Determines if the given join type is supported.
 /// </summary>
 /// <param name="joinType">The join type</param>
 /// <returns>True if the join type is supported, false otherwise</returns>
 public virtual bool IsSupported(QueryJoinType joinType)
 {
     return(true);
 }
示例#14
0
		public static string GetJoinTypeString(QueryJoinType type)
		{
			switch (type)
			{
				case QueryJoinType.Inner: return "INNER";
				case QueryJoinType.Outer: return "OUTER";
				case QueryJoinType.Left: return "LEFT";
				case QueryJoinType.Right: return "RIGHT";
				default: return "";
			}
		}
示例#15
0
		/// <summary>
		/// Very simple join, joining two tables (not table elements) with a specified join type.
		/// </summary>
		public Join(object ColumnEnum1, object ColumnEnum2, QueryJoinType JoinType)
		{
			Init(ColumnEnum1);
			this.TableElement1 = new TableElement(ColumnEnum1);
			this.TableElement2 = new TableElement(ColumnEnum2);
			this.JoinCondition = new Q(ColumnEnum1, ColumnEnum2, true);
			this.JoinType = JoinType;
		}
示例#16
0
		/// <summary>
		/// Very simple join, joining a TableElement (a join) to a table with an inner join.
		/// </summary>
		public Join(TableElement t1, object ColumnEnum2, object ColumnEnum1ForCondition)
		{
			Init(t1);
			this.TableElement1 = t1;
			this.TableElement2 = new TableElement(ColumnEnum2);
			this.JoinCondition = new Q(ColumnEnum1ForCondition, ColumnEnum2, true);
			this.JoinType = QueryJoinType.Inner;
		}
示例#17
0
 public static IQueryJoin EntityType(Type from, Type to, String alias, QueryJoinType joinType)
 {
     return(EntityType(from, to, null, joinType, alias));
 }
示例#18
0
 public void SwitchInnerJoin()
 {
     m_joinType = QueryJoinType.Inner;
     Invalidate();
 }
示例#19
0
 public void SwitchRightJoin()
 {
     m_joinType = QueryJoinType.Right;
     Invalidate();
 }
示例#20
0
		/// <summary>
		/// Simple join with two table elements:
		/// TableElement1 JoinType JOIN TableElement2 ON ColumnEnum1 = ColumnEnum2
		/// </summary>
		public Join(TableElement TableElement1, TableElement TableElement2, QueryJoinType JoinType, object ColumnEnum1, object ColumnEnum2)
		{
			Init(TableElement1);
			this.TableElement1 = TableElement1;
			this.TableElement2 = TableElement2;
			this.JoinCondition = new Q(ColumnEnum1, ColumnEnum2, true);
			this.JoinType = JoinType;
		}