hql.g:171:1: setClause : ( SET ^ assignment ( COMMA ! assignment )* ) ;
553321
public final hqlParser.setClause_return setClause() throws RecognitionException {
		hqlParser.setClause_return retval = new hqlParser.setClause_return();
		retval.start = input.LT(1);

		CommonTree root_0 = null;

		Token SET11=null;
		Token COMMA13=null;
		ParserRuleReturnScope assignment12 =null;
		ParserRuleReturnScope assignment14 =null;

		CommonTree SET11_tree=null;
		CommonTree COMMA13_tree=null;

		try {
			// hql.g:172:2: ( ( SET ^ assignment ( COMMA ! assignment )* ) )
			// hql.g:172:4: ( SET ^ assignment ( COMMA ! assignment )* )
			{
			root_0 = (CommonTree)adaptor.nil();


			// hql.g:172:4: ( SET ^ assignment ( COMMA ! assignment )* )
			// hql.g:172:5: SET ^ assignment ( COMMA ! assignment )*
			{
			SET11=(Token)match(input,SET,FOLLOW_SET_in_setClause660);
			SET11_tree = (CommonTree)adaptor.create(SET11);
			root_0 = (CommonTree)adaptor.becomeRoot(SET11_tree, root_0);

			pushFollow(FOLLOW_assignment_in_setClause663);
			assignment12=assignment();
			state._fsp--;

			adaptor.addChild(root_0, assignment12.getTree());

			// hql.g:172:21: ( COMMA ! assignment )*
			loop4:
			while (true) {
				int alt4=2;
				int LA4_0 = input.LA(1);
				if ( (LA4_0==COMMA) ) {
					alt4=1;
				}

				switch (alt4) {
				case 1 :
					// hql.g:172:22: COMMA ! assignment
					{
					COMMA13=(Token)match(input,COMMA,FOLLOW_COMMA_in_setClause666);
					pushFollow(FOLLOW_assignment_in_setClause669);
					assignment14=assignment();
					state._fsp--;

					adaptor.addChild(root_0, assignment14.getTree());

					}
					break;

				default :
					break loop4;
				}
			}

			}

			}

			retval.stop = input.LT(-1);

			retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
527867
@Override
    protected FromClause getFromClause(List<ColumnSpec> columnSpecs,
            TableAliaser referenceIndices) {
        return new Ojdbc6OracleFromClause(getEntitySpec(), columnSpecs, referenceIndices);
    }
681877
public final void mTHEN() throws RecognitionException {
		try {
			int _type = THEN;
			int _channel = DEFAULT_TOKEN_CHANNEL;
			// hql.g:64:6: ( 'then' )
			// hql.g:64:8: 'then'
			{
			match("then"); if (state.failed) return;

			}

			state.type = _type;
			state.channel = _channel;
		}
		finally {
			// do for sure before leaving
		}
	}
1034242
protected void appendHavingClause(StringBuffer having, Criteria crit, StringBuffer stmt)
    {
        if (having.length() == 0)
        {
            having = null;
        }

        if (having != null || crit != null)
        {
            stmt.append(" HAVING ");
            appendClause(having, crit, stmt);
        }
    }
1131937
@Override
    public StringBuilder getFilterClause() {
        StringBuilder builder = new StringBuilder();
        builder.append(columnName);
        builder.append(" =");
        builder.append(':').append(name);
        return builder;
    }
150582
public final hqlParser.updateStatement_return updateStatement() throws RecognitionException {
		hqlParser.updateStatement_return retval = new hqlParser.updateStatement_return();
		retval.start = input.LT(1);

		CommonTree root_0 = null;

		Token UPDATE6=null;
		Token VERSIONED7=null;
		ParserRuleReturnScope optionalFromTokenFromClause8 =null;
		ParserRuleReturnScope setClause9 =null;
		ParserRuleReturnScope whereClause10 =null;

		CommonTree UPDATE6_tree=null;
		CommonTree VERSIONED7_tree=null;

		try {
			// hql.g:165:2: ( UPDATE ^ ( VERSIONED )? optionalFromTokenFromClause setClause ( whereClause )? )
			// hql.g:165:4: UPDATE ^ ( VERSIONED )? optionalFromTokenFromClause setClause ( whereClause )?
			{
			root_0 = (CommonTree)adaptor.nil();


			UPDATE6=(Token)match(input,UPDATE,FOLLOW_UPDATE_in_updateStatement627);
			UPDATE6_tree = (CommonTree)adaptor.create(UPDATE6);
			root_0 = (CommonTree)adaptor.becomeRoot(UPDATE6_tree, root_0);

			// hql.g:165:12: ( VERSIONED )?
			int alt2=2;
			int LA2_0 = input.LA(1);
			if ( (LA2_0==VERSIONED) ) {
				alt2=1;
			}
			switch (alt2) {
				case 1 :
					// hql.g:165:13: VERSIONED
					{
					VERSIONED7=(Token)match(input,VERSIONED,FOLLOW_VERSIONED_in_updateStatement631);
					VERSIONED7_tree = (CommonTree)adaptor.create(VERSIONED7);
					adaptor.addChild(root_0, VERSIONED7_tree);

					}
					break;

			}

			pushFollow(FOLLOW_optionalFromTokenFromClause_in_updateStatement637);
			optionalFromTokenFromClause8=optionalFromTokenFromClause();
			state._fsp--;

			adaptor.addChild(root_0, optionalFromTokenFromClause8.getTree());

			pushFollow(FOLLOW_setClause_in_updateStatement641);
			setClause9=setClause();
			state._fsp--;

			adaptor.addChild(root_0, setClause9.getTree());

			// hql.g:168:3: ( whereClause )?
			int alt3=2;
			int LA3_0 = input.LA(1);
			if ( (LA3_0==WHERE) ) {
				alt3=1;
			}
			switch (alt3) {
				case 1 :
					// hql.g:168:4: whereClause
					{
					pushFollow(FOLLOW_whereClause_in_updateStatement646);
					whereClause10=whereClause();
					state._fsp--;

					adaptor.addChild(root_0, whereClause10.getTree());

					}
					break;

			}

			}

			retval.stop = input.LT(-1);

			retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
123598
public static int update(Connection connection, String table,
			ContentValues values, String whereClause, String[] whereArgs) {

		StringBuilder update = new StringBuilder();
		update.append("update ").append(CoreSQLUtils.quoteWrap(table))
				.append(" set ");

		int setValuesSize = values.size();
		int argsSize = (whereArgs == null) ? setValuesSize
				: (setValuesSize + whereArgs.length);
		Object[] args = new Object[argsSize];
		int i = 0;
		for (String colName : values.keySet()) {
			update.append((i > 0) ? "," : "");
			update.append(CoreSQLUtils.quoteWrap(colName));
			args[i++] = values.get(colName);
			update.append("=?");
		}
		if (whereArgs != null) {
			for (i = setValuesSize; i < argsSize; i++) {
				args[i] = whereArgs[i - setValuesSize];
			}
		}
		if (whereClause != null) {
			update.append(" WHERE ");
			update.append(whereClause);
		}
		String sql = update.toString();

		PreparedStatement statement = null;

		int count = 0;
		try {
			statement = connection.prepareStatement(sql);
			setArguments(statement, args);
			count = statement.executeUpdate();
		} catch (SQLException e) {
			throw new GeoPackageException(
					"Failed to execute SQL update statement: " + sql, e);
		} finally {
			closeStatement(statement, sql);
		}

		return count;
	}
1079474
public final void mMULT_ASSIGN() throws RecognitionException {
		try {
			int _type = MULT_ASSIGN;
			int _channel = DEFAULT_TOKEN_CHANNEL;
			// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:164:5: ( '*=' )
			// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:164:7: '*='
			{
			match("*="); if (state.failed) return;

			}

			state.type = _type;
			state.channel = _channel;
		}
		finally {
			// do for sure before leaving
		}
	}
699847
public String asSQLStatement(Criteria crit, ClassDescriptor cld)
    {
        Enumeration e = crit.getElements();
        StringBuffer statement = new StringBuffer();
        while (e.hasMoreElements())
        {
            Object o = e.nextElement();
            if (o instanceof Criteria)
            {
                String addAtStart;
                String addAtEnd;
                Criteria pc = (Criteria) o;
                // need to add parenthesises?
                if (pc.isEmbraced())
                {
                    addAtStart = " (";
                    addAtEnd = ") ";
                }
                else
                {
                    addAtStart = "";
                    addAtEnd = "";
                }

                switch (pc.getType())
                {
                    case (Criteria.OR) :
                        {
                            statement.append(" OR ").append(addAtStart);
                            statement.append(asSQLStatement(pc, cld));
                            statement.append(addAtEnd);
                            break;
                        }
                    case (Criteria.AND) :
                        {
                            statement.insert(0, "( ");
                            statement.append(") ");
                            statement.append(" AND ").append(addAtStart);
                            statement.append(asSQLStatement(pc, cld));
                            statement.append(addAtEnd);
                            break;
                        }
                }
            }
            else
            {
                SelectionCriteria c = (SelectionCriteria) o;
                if (statement.length() == 0)
                {
                    statement.append(asSQLClause(c, cld));
                }
                else
                {
                    statement.insert(0, "(");
                    statement.append(") ");
                    statement.append(" AND ");
                    statement.append(asSQLClause(c, cld));
                }
            }
        } // while
        if (statement.length() == 0)
        {
            return null;
        }
        return statement.toString();
    }
274663
private void executeAssumeStatement(Tree statement)
    {
        if (!CliMain.isConnected() || !hasKeySpace())
            return;

        String cfName = CliCompiler.getColumnFamily(statement, currentCfDefs());

        // VALIDATOR | COMPARATOR | KEYS | SUB_COMPARATOR
        String assumptionElement = statement.getChild(1).getText().toUpperCase();


        // Could be UTF8Type, IntegerType, LexicalUUIDType etc.
        String defaultType = CliUtils.unescapeSQLString(statement.getChild(2).getText());

        if (applyAssumption(cfName, assumptionElement, defaultType))
        {
            assumptions.addAssumption(keySpace, cfName, assumptionElement, defaultType);
            sessionState.out.println(String.format("Assumption for column family '%s' added successfully.", cfName));
        }
    }
410995
StatementDMQL compileMergeStatement(RangeVariable[] outerRanges) {

        boolean[]     insertColumnCheckList;
        int[]         insertColumnMap = null;
        int[]         updateColumnMap = null;
        int[]         baseUpdateColumnMap;
        Table         table;
        RangeVariable targetRange;
        RangeVariable sourceRange;
        Expression    mergeCondition;
        HsqlArrayList updateList        = new HsqlArrayList();
        Expression[]  updateExpressions = null;
        HsqlArrayList insertList        = new HsqlArrayList();
        Expression    insertExpression  = null;

        read();
        readThis(Tokens.INTO);

        targetRange = readSimpleRangeVariable(StatementTypes.MERGE);
        table       = targetRange.rangeTable;

        readThis(Tokens.USING);

        sourceRange = readTableOrSubquery();

        // parse ON search conditions
        readThis(Tokens.ON);

        mergeCondition = XreadBooleanValueExpression();

        if (mergeCondition.getDataType() != Type.SQL_BOOLEAN) {
            throw Error.error(ErrorCode.X_42568);
        }

        RangeVariable[] fullRangeVars   = new RangeVariable[] {
            sourceRange, targetRange
        };
        RangeVariable[] sourceRangeVars = new RangeVariable[]{ sourceRange };
        RangeVariable[] targetRangeVars = new RangeVariable[]{ targetRange };

        // parse WHEN clause(s) and convert lists to arrays
        insertColumnMap       = table.getColumnMap();
        insertColumnCheckList = table.getNewColumnCheckList();

        OrderedHashSet updateColNames = new OrderedHashSet();
        OrderedHashSet insertColNames = new OrderedHashSet();

        readMergeWhen(insertColNames, updateColNames, insertList, updateList,
                      targetRangeVars, sourceRange);

        if (insertList.size() > 0) {
            int colCount = insertColNames.size();

            if (colCount != 0) {
                insertColumnMap = table.getColumnIndexes(insertColNames);
                insertColumnCheckList =
                    table.getColumnCheckList(insertColumnMap);
            }

            insertExpression = (Expression) insertList.get(0);

            setParameterTypes(insertExpression, table, insertColumnMap);
        }

        if (updateList.size() > 0) {
            updateExpressions = new Expression[updateList.size()];

            updateList.toArray(updateExpressions);

            updateColumnMap = table.getColumnIndexes(updateColNames);
        }

        if (updateExpressions != null) {
            Table baseTable = table.getBaseTable();

            baseUpdateColumnMap = updateColumnMap;

            if (table != baseTable) {
                baseUpdateColumnMap = new int[updateColumnMap.length];

                ArrayUtil.projectRow(table.getBaseTableColumnMap(),
                                     updateColumnMap, baseUpdateColumnMap);
            }

            resolveUpdateExpressions(table, sourceRangeVars, updateColumnMap,
                                     updateExpressions, outerRanges);
        }

        HsqlList unresolved = null;

        unresolved = mergeCondition.resolveColumnReferences(fullRangeVars,
                null);

        ExpressionColumn.checkColumnsResolved(unresolved);
        mergeCondition.resolveTypes(session, null);

        if (mergeCondition.isParam()) {
            mergeCondition.dataType = Type.SQL_BOOLEAN;
        }

        if (mergeCondition.getDataType() != Type.SQL_BOOLEAN) {
            throw Error.error(ErrorCode.X_42568);
        }

        RangeVariableResolver resolver =
            new RangeVariableResolver(fullRangeVars, mergeCondition,
                                      compileContext);

        resolver.processConditions();

        fullRangeVars = resolver.rangeVariables;

        if (insertExpression != null) {
            unresolved =
                insertExpression.resolveColumnReferences(sourceRangeVars,
                    unresolved);

            ExpressionColumn.checkColumnsResolved(unresolved);
            insertExpression.resolveTypes(session, null);
        }

        StatementDMQL cs = new StatementDML(session, fullRangeVars,
                                            insertColumnMap, updateColumnMap,
                                            insertColumnCheckList,
                                            mergeCondition, insertExpression,
                                            updateExpressions, compileContext);

        return cs;
    }
817244
StatementDMQL compileCallStatement(RangeVariable[] outerRanges,
                                       boolean isStrictlyProcedure) {

        read();

        if (isIdentifier()) {
            checkValidCatalogName(token.namePrePrefix);

            RoutineSchema routineSchema =
                (RoutineSchema) database.schemaManager.findSchemaObject(
                    token.tokenString,
                    session.getSchemaName(token.namePrefix),
                    SchemaObject.PROCEDURE);

            if (routineSchema != null) {
                read();

                HsqlArrayList list = new HsqlArrayList();

                readThis(Tokens.OPENBRACKET);

                if (token.tokenType == Tokens.CLOSEBRACKET) {
                    read();
                } else {
                    while (true) {
                        Expression e = XreadValueExpression();

                        list.add(e);

                        if (token.tokenType == Tokens.COMMA) {
                            read();
                        } else {
                            readThis(Tokens.CLOSEBRACKET);

                            break;
                        }
                    }
                }

                Expression[] arguments = new Expression[list.size()];

                list.toArray(arguments);

                Routine routine =
                    routineSchema.getSpecificRoutine(arguments.length);
                HsqlList unresolved = null;

                for (int i = 0; i < arguments.length; i++) {
                    Expression e = arguments[i];

                    if (e.isParam()) {
                        e.setAttributesAsColumn(
                            routine.getParameter(i),
                            routine.getParameter(i).isWriteable());
                    } else {
                        int paramMode =
                            routine.getParameter(i).getParameterMode();

                        unresolved =
                            arguments[i].resolveColumnReferences(outerRanges,
                                unresolved);

                        if (paramMode
                                != SchemaObject.ParameterModes.PARAM_IN) {
                            if (e.getType() != OpTypes.VARIABLE) {
                                throw Error.error(ErrorCode.X_42603);
                            }
                        }
                    }
                }

                ExpressionColumn.checkColumnsResolved(unresolved);

                for (int i = 0; i < arguments.length; i++) {
                    arguments[i].resolveTypes(session, null);
                }

                StatementDMQL cs = new StatementProcedure(session, routine,
                    arguments, compileContext);

                return cs;
            }
        }

        if (isStrictlyProcedure) {
            throw Error.error(ErrorCode.X_42501, token.tokenString);
        }

        Expression expression = this.XreadValueExpression();
        HsqlList unresolved = expression.resolveColumnReferences(outerRanges,
            null);

        ExpressionColumn.checkColumnsResolved(unresolved);
        expression.resolveTypes(session, null);

//        expression.paramMode = PARAM_OUT;
        StatementDMQL cs = new StatementProcedure(session, expression,
            compileContext);

        return cs;
    }
1042450
public final void mEXPONENT() throws RecognitionException {
		try {
			// hql.g:871:2: ( ( 'e' ) ( '+' | '-' )? ( '0' .. '9' )+ )
			// hql.g:871:4: ( 'e' ) ( '+' | '-' )? ( '0' .. '9' )+
			{
			// hql.g:871:4: ( 'e' )
			// hql.g:871:5: 'e'
			{
			match('e'); if (state.failed) return;
			}

			// hql.g:871:10: ( '+' | '-' )?
			int alt21=2;
			int LA21_0 = input.LA(1);
			if ( (LA21_0=='+'||LA21_0=='-') ) {
				alt21=1;
			}
			switch (alt21) {
				case 1 :
					// hql.g:
					{
					if ( input.LA(1)=='+'||input.LA(1)=='-' ) {
						input.consume();
						state.failed=false;
					}
					else {
						if (state.backtracking>0) {state.failed=true; return;}
						MismatchedSetException mse = new MismatchedSetException(null,input);
						recover(mse);
						throw mse;
					}
					}
					break;

			}

			// hql.g:871:21: ( '0' .. '9' )+
			int cnt22=0;
			loop22:
			while (true) {
				int alt22=2;
				int LA22_0 = input.LA(1);
				if ( ((LA22_0 >= '0' && LA22_0 <= '9')) ) {
					alt22=1;
				}

				switch (alt22) {
				case 1 :
					// hql.g:
					{
					if ( (input.LA(1) >= '0' && input.LA(1) <= '9') ) {
						input.consume();
						state.failed=false;
					}
					else {
						if (state.backtracking>0) {state.failed=true; return;}
						MismatchedSetException mse = new MismatchedSetException(null,input);
						recover(mse);
						throw mse;
					}
					}
					break;

				default :
					if ( cnt22 >= 1 ) break loop22;
					if (state.backtracking>0) {state.failed=true; return;}
					EarlyExitException eee = new EarlyExitException(22, input);
					throw eee;
				}
				cnt22++;
			}

			}

		}
		finally {
			// do for sure before leaving
		}
	}
728650
public final void ruleAssignableAlternatives() throws RecognitionException {

        		int stackSize = keepStackSize();
        	
        try {
            // InternalXtext.g:983:2: ( ( ( rule__AssignableAlternatives__Group__0 ) ) )
            // InternalXtext.g:984:2: ( ( rule__AssignableAlternatives__Group__0 ) )
            {
            // InternalXtext.g:984:2: ( ( rule__AssignableAlternatives__Group__0 ) )
            // InternalXtext.g:985:3: ( rule__AssignableAlternatives__Group__0 )
            {
             before(grammarAccess.getAssignableAlternativesAccess().getGroup()); 
            // InternalXtext.g:986:3: ( rule__AssignableAlternatives__Group__0 )
            // InternalXtext.g:986:4: rule__AssignableAlternatives__Group__0
            {
            pushFollow(FollowSets000.FOLLOW_2);
            rule__AssignableAlternatives__Group__0();

            state._fsp--;


            }

             after(grammarAccess.getAssignableAlternativesAccess().getGroup()); 

            }


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {

            	restoreStackSize(stackSize);

        }
        return ;
    }
921741
public final void mLT() throws RecognitionException {
		try {
			int _type = LT;
			int _channel = DEFAULT_TOKEN_CHANNEL;
			// hql.g:735:3: ( '<' )
			// hql.g:735:5: '<'
			{
			match('<'); if (state.failed) return;
			}

			state.type = _type;
			state.channel = _channel;
		}
		finally {
			// do for sure before leaving
		}
	}
932598
public void buildSetClause(EntityMetadata m, StringBuilder builder, String property, Object value)
    {
        builder = ensureCase(builder, property, false);
        builder.append(EQ_CLAUSE);

        if (m.isCounterColumnType())
        {
            builder = ensureCase(builder, property, false);
            builder.append(INCR_COUNTER);
            builder.append(value);
        }
        else
        {
            appendValue(builder, value.getClass(), value, false, false);
        }

        builder.append(COMMA_STR);
    }
1186605
public final void ruleAssignment() throws RecognitionException {

        		int stackSize = keepStackSize();
        	
        try {
            // InternalXtext.g:908:2: ( ( ( rule__Assignment__Group__0 ) ) )
            // InternalXtext.g:909:2: ( ( rule__Assignment__Group__0 ) )
            {
            // InternalXtext.g:909:2: ( ( rule__Assignment__Group__0 ) )
            // InternalXtext.g:910:3: ( rule__Assignment__Group__0 )
            {
             before(grammarAccess.getAssignmentAccess().getGroup()); 
            // InternalXtext.g:911:3: ( rule__Assignment__Group__0 )
            // InternalXtext.g:911:4: rule__Assignment__Group__0
            {
            pushFollow(FollowSets000.FOLLOW_2);
            rule__Assignment__Group__0();

            state._fsp--;


            }

             after(grammarAccess.getAssignmentAccess().getGroup()); 

            }


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {

            	restoreStackSize(stackSize);

        }
        return ;
    }