Esempio n. 1
0
		private bool Initialize()
		{
			if (CurrentNode.Id == Terminals.Into)
			{
				_insertTarget = SemanticModel.InsertTargets.FirstOrDefault(t => CurrentNode.HasAncestor(t.RootNode));
			}
			else
			{
				var isSingleTableInsert = CurrentNode.Id == Terminals.Insert &&
				                          CurrentNode.ParentNode[NonTerminals.SingleTableInsertOrMultiTableInsert, NonTerminals.SingleTableInsert] != null;
				if (isSingleTableInsert && SemanticModel.InsertTargets.Count == 1)
				{
					_insertTarget = SemanticModel.InsertTargets.First();
				}
			}

			return _insertTarget?.DataObjectReference != null;
		}
        private bool Initialize()
        {
            if (CurrentNode.Id == Terminals.Into)
            {
                _insertTarget = SemanticModel.InsertTargets.FirstOrDefault(t => CurrentNode.HasAncestor(t.RootNode));
            }
            else
            {
                var isSingleTableInsert = CurrentNode.Id == Terminals.Insert &&
                                          CurrentNode.ParentNode[NonTerminals.SingleTableInsertOrMultiTableInsert, NonTerminals.SingleTableInsert] != null;
                if (isSingleTableInsert && SemanticModel.InsertTargets.Count == 1)
                {
                    _insertTarget = SemanticModel.InsertTargets.First();
                }
            }

            return(_insertTarget?.DataObjectReference != null);
        }
 private static StatementGrammarNode GetInsertTargetColumnAtPosition(OracleInsertTarget insertTarget, int columnIndex)
 {
     return(insertTarget.Columns.Keys.Skip(columnIndex).First());
 }