/// <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; }
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(); }
public static IQueryJoin EntityType(Type from, Type to, QueryJoinType joinType) { return(EntityType(from, to, null, joinType, null)); }
public static IQueryJoin EntityType <T, TU>(String alias, QueryJoinType joinType) { return(EntityType(typeof(T), typeof(TU), null, joinType, alias)); }
public static IQueryJoin EntityType <T, TU>(QueryJoinType joinType) { return(EntityType(typeof(T), typeof(TU), null, joinType, null)); }
/// <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(); }
public void SwitchLeftJoin() { m_joinType = QueryJoinType.Left; Invalidate(); }
/// <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; }
// 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); }
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 ""; } }
/// <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; }
/// <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; }
public static IQueryJoin EntityType(Type from, Type to, String alias, QueryJoinType joinType) { return(EntityType(from, to, null, joinType, alias)); }
public void SwitchInnerJoin() { m_joinType = QueryJoinType.Inner; Invalidate(); }
public void SwitchRightJoin() { m_joinType = QueryJoinType.Right; Invalidate(); }
/// <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; }