void SetupDataSelectSet(SelectSet selectSet) { dataSelectSet = selectSet; if (selectSet != null) { // data SelectSet context must be between over local and any under child view contexts ExpressionParsingContext = new ExpressionParsingContext(ExpressionParsingContext, dataSelectSet); } }
public Where Build(ViewSchema vs, ViewTable vTable, SelectSet selectSet, Select select, Schema baseSchema, Table table, Operation.ExpressionParsingContext expressionParsingContext) { Where w = new Where(); var option = new Operation.Expression.ParseIdentifierOption(vs, table, true, false, null, expressionParsingContext); option.formatError = (msg, y) => { return(FormatErrorContextInfo(vs, vTable, select) + msg); }; option.BypassSelectSetCondition = selectSet; w.m_Comparison = comparison.Build(option); return(w); }
void SetupLocalSelectSet(SelectSet selectSet) { if (dataSelectSet != null) { Debug.LogError("SetLocalSelectSet must be called before setting up DataSelectSet"); } localSelectSet = selectSet; if (selectSet != null) { // local SelectSet context must be over parent and under data context ExpressionParsingContext = new ExpressionParsingContext(ParentExpressionParsingContext, localSelectSet); } }
public void Build(ViewSchema vs, ViewTable vTable, SelectSet selectSet, Select sel, Database.Schema baseSchema, Operation.ExpressionParsingContext expressionParsingContext) { if (where.Count > 0) { sel.where = new WhereUnion(); foreach (var w in where) { var w2 = w.Build(vs, vTable, selectSet, sel, baseSchema, sel.sourceTable, expressionParsingContext); if (w2.Comparison.IsManyToMany()) { sel.isManyToMany = true; } sel.where.Add(w2); } } }
public SelectSet Build(ViewTable viewTable, ViewSchema viewSchema, Database.Schema baseSchema) { if (select.Count == 0) { return(null); } SelectSet selectSet = new SelectSet(); // Create select statements (first pass) foreach (var iSelect in select) { Select s = iSelect.Create(viewTable.ViewSchema, baseSchema, viewTable); if (s != null) { selectSet.Add(s); } else { Debug.LogError("Could not create Select named '" + iSelect.name + "'"); } } // add current set to the expression parsing hierarchy var expressionParsingContext = new Operation.ExpressionParsingContext(viewTable.ExpressionParsingContext, selectSet); // Build select statements (second pass) var eSelBuilder = select.GetEnumerator(); var eSelList = selectSet.select.GetEnumerator(); while (eSelBuilder.MoveNext()) { eSelList.MoveNext(); eSelBuilder.Current.Build(viewSchema, viewTable, selectSet, eSelList.Current, baseSchema, expressionParsingContext); } if (Condition != null) { Operation.Expression.ParseIdentifierOption parseOpt = new Operation.Expression.ParseIdentifierOption(viewSchema, viewTable, true, false, null, expressionParsingContext); parseOpt.BypassSelectSetCondition = selectSet; selectSet.Condition = Condition.Build(parseOpt); } return(selectSet); }
public WhereUnion(List <Where.Builder> builders, ViewSchema vs, ViewTable vTable, SelectSet selectSet, Select select, Schema baseSchema, Table table, Operation.ExpressionParsingContext expressionParsingContext) { foreach (var b in builders) { Add(b.Build(vs, vTable, selectSet, select, baseSchema, table, expressionParsingContext)); } }