当前位置: 首页>>代码示例>>Java>>正文


Java Update.getExpressions方法代码示例

本文整理汇总了Java中net.sf.jsqlparser.statement.update.Update.getExpressions方法的典型用法代码示例。如果您正苦于以下问题:Java Update.getExpressions方法的具体用法?Java Update.getExpressions怎么用?Java Update.getExpressions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.sf.jsqlparser.statement.update.Update的用法示例。


在下文中一共展示了Update.getExpressions方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createUpdateMutation

import net.sf.jsqlparser.statement.update.Update; //导入方法依赖的package包/类
private Mutation createUpdateMutation(Update update, boolean generateParameterMetaData) throws SQLException
{
	if (update.getTables().isEmpty())
		throw new CloudSpannerSQLException("No table found in update statement", Code.INVALID_ARGUMENT);
	if (update.getTables().size() > 1)
		throw new CloudSpannerSQLException("Update statements for multiple tables at once are not supported",
				Code.INVALID_ARGUMENT);
	String table = unquoteIdentifier(update.getTables().get(0).getFullyQualifiedName());
	getParameterStore().setTable(table);
	List<Expression> expressions = update.getExpressions();
	WriteBuilder builder = Mutation.newUpdateBuilder(table);
	int index = 0;
	for (Column col : update.getColumns())
	{
		String columnName = unquoteIdentifier(col.getFullyQualifiedName());
		expressions.get(index).accept(new ValueBinderExpressionVisitorAdapter<>(getParameterStore(),
				builder.set(columnName), columnName));
		index++;
	}
	visitUpdateWhereClause(update.getWhere(), builder, generateParameterMetaData);

	return builder.build();
}
 
开发者ID:olavloite,项目名称:spanner-jdbc,代码行数:24,代码来源:CloudSpannerPreparedStatement.java

示例2: visit

import net.sf.jsqlparser.statement.update.Update; //导入方法依赖的package包/类
@Override
public void visit(Update update) {
    for (Table table : update.getTables()) {
        tables.add(table.getName());
    }
    if (update.getExpressions() != null) {
        for (Expression expression : update.getExpressions()) {
            expression.accept(this);
        }
    }

    if (update.getFromItem() != null) {
        update.getFromItem().accept(this);
    }

    if (update.getJoins() != null) {
        for (Join join : update.getJoins()) {
            join.getRightItem().accept(this);
        }
    }

    if (update.getWhere() != null) {
        update.getWhere().accept(this);
    }
}
 
开发者ID:WeiMei-Tian,项目名称:editor-sql,代码行数:26,代码来源:TablesNamesFinder.java

示例3: visit

import net.sf.jsqlparser.statement.update.Update; //导入方法依赖的package包/类
@Override
public void visit(Update update) {
    for (Table table : update.getTables()) {
        tables.add(table, table1 -> table.getName());
    }
    if (update.getExpressions() != null) {
        for (Expression expression : update.getExpressions()) {
            expression.accept(this);
        }
    }

    if (update.getFromItem() != null) {
        update.getFromItem().accept(this);
    }

    if (update.getJoins() != null) {
        for (Join join : update.getJoins()) {
            join.getRightItem().accept(this);
        }
    }

    if (update.getWhere() != null) {
        update.getWhere().accept(this);
    }
}
 
开发者ID:justice-code,项目名称:QiuQiu,代码行数:26,代码来源:ReplaceTablesNamesFinder.java

示例4: visit

import net.sf.jsqlparser.statement.update.Update; //导入方法依赖的package包/类
@Override
public void visit(Update update) {
    if (update.getExpressions() != null) {
        for (Expression expression : update.getExpressions()) {
            expression.accept(this);
        }
    }

    if (update.getFromItem() != null) {
        update.getFromItem().accept(this);
    }

    if (update.getJoins() != null) {
        for (Join join : update.getJoins()) {
            join.getRightItem().accept(this);
        }
    }

    if (update.getWhere() != null) {
        update.getWhere().accept(this);
    }
}
 
开发者ID:hellojavaer,项目名称:ddal,代码行数:23,代码来源:JSQLBaseVisitor.java

示例5: updateCase

import net.sf.jsqlparser.statement.update.Update; //导入方法依赖的package包/类
private void updateCase(Update update){
    List<Column> columns = update.getColumns();
    System.out.println(columns);
    List<Expression> expressions = update.getExpressions();
    int index = 0;
    for (Expression exp:expressions){
        handleColumn(columns.get(index),exp,paramNames);
        index++;
    }
    handleWhereCause(update.getWhere(), paramNames);
}
 
开发者ID:rpgmakervx,项目名称:slardar,代码行数:12,代码来源:JSqlParser.java

示例6: visit

import net.sf.jsqlparser.statement.update.Update; //导入方法依赖的package包/类
@Override
public void visit(Update s) {
    for (Table table : s.getTables()) {
        visit(table);
    }
    if (s.getColumns() != null) {
        s.getColumns().forEach(c -> {
            c.accept(this);
        });
    }
    if (s.getExpressions() != null) {
        s.getExpressions().forEach(e -> e.accept(this));
    }
    if (s.getOrderByElements() != null) {
        s.getOrderByElements().forEach(o -> {
            o.accept(this);
        });
    }
    if (s.getWhere() != null) {
        s.getWhere().accept(this);
    }
    if (s.getReturningExpressionList() != null) {
        s.getReturningExpressionList().forEach(o -> {
            o.accept(this);
        });

    }
}
 
开发者ID:diennea,项目名称:herddb,代码行数:29,代码来源:JdbcQueryRewriter.java

示例7: visit

import net.sf.jsqlparser.statement.update.Update; //导入方法依赖的package包/类
@Override
public void visit(Update update)
{
    for (Table table : update.getTables())
    {
    	table.accept(this);
    }
    if (update.getExpressions() != null)
    {
        for (Expression expression : update.getExpressions())
        {
            expression.accept(this);
        }
    }

    if (update.getFromItem() != null)
    {
        update.getFromItem().accept(this);
    }

    if (update.getJoins() != null)
    {
        for (Join join : update.getJoins())
        {
            join.getRightItem().accept(this);
        }
    }

    if (update.getWhere() != null)
    {
        update.getWhere().accept(this);
    }
}
 
开发者ID:sogou-biztech,项目名称:compass,代码行数:34,代码来源:TableRenameVisitor.java

示例8: buildUpdateStatement

import net.sf.jsqlparser.statement.update.Update; //导入方法依赖的package包/类
private ExecutionPlan buildUpdateStatement(String defaultTableSpace, Update s,
    boolean returnValues) throws StatementExecutionException {
    if (s.getTables().size() != 1) {
        throw new StatementExecutionException("unsupported multi-table update " + s);
    }
    net.sf.jsqlparser.schema.Table fromTable = s.getTables().get(0);
    String tableSpace = fromTable.getSchemaName();
    String tableName = fromTable.getName();
    if (tableSpace == null) {
        tableSpace = defaultTableSpace;
    }
    TableSpaceManager tableSpaceManager = manager.getTableSpaceManager(tableSpace);
    if (tableSpaceManager == null) {
        throw new StatementExecutionException("no such tablespace " + tableSpace + " here at " + manager.getNodeId());
    }
    AbstractTableManager tableManager = tableSpaceManager.getTableManager(tableName);
    if (tableManager == null) {
        throw new StatementExecutionException("no such table " + tableName + " in tablespace " + tableSpace);
    }
    Table table = tableManager.getTable();
    for (net.sf.jsqlparser.schema.Column c : s.getColumns()) {
        Column column = table.getColumn(c.getColumnName());
        if (column == null) {
            throw new StatementExecutionException("no such column " + c.getColumnName() + " in table " + tableName + " in tablespace " + tableSpace);
        }
        if (table.isPrimaryKeyColumn(c.getColumnName())) {
            throw new StatementExecutionException("updates of fields on the PK (" + Arrays.toString(table.primaryKey) + ") are not supported. Please perform a DELETE and than an INSERT");
        }
    }

    List<CompiledSQLExpression> compiledSQLExpressions = new ArrayList<>();
    for (Expression e : s.getExpressions()) {
        compiledSQLExpressions.add(SQLExpressionCompiler.compileExpression(null, e));
    }
    RecordFunction function = new SQLRecordFunction(table, s.getColumns(), compiledSQLExpressions);

    // Perform a scan and then update each row
    SQLRecordPredicate where = s.getWhere() != null ? new SQLRecordPredicate(table, table.name, s.getWhere()) : null;
    if (where != null) {
        Expression expressionWhere = s.getWhere();
        discoverIndexOperations(expressionWhere, table, table.name, where, tableSpaceManager);
    }
    DMLStatement st = new UpdateStatement(tableSpace, tableName, null, function, where)
        .setReturnValues(returnValues);
    return ExecutionPlan.simple(st);

}
 
开发者ID:diennea,项目名称:herddb,代码行数:48,代码来源:SQLPlanner.java


注:本文中的net.sf.jsqlparser.statement.update.Update.getExpressions方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。