Java Code Examples for

The following examples show how to use . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File:    From dts with Apache License 2.0 5 votes vote down vote up
public TableDataInfo getPresentValue(List<Object> sqlParamsList, SQLUpdateStatement parseSqlStatement,
    StatementAdapter statementAdapter, TableMetaInfo tableMetaInfo) throws SQLException {
    TableDataInfo txcTable = new TableDataInfo();
    TxcLine txcLine = new TxcLine();
    List<SQLUpdateSetItem> items = parseSqlStatement.getItems();
    int variantExpr = 0;
    for (int i = 0; i < items.size(); i++) {
        SQLUpdateSetItem sqlUpdateSetItem = items.get(i);
        TxcField txcField = new TxcField();
        String cloumnName =
            SQLUtils.toSQLString(sqlUpdateSetItem.getColumn()).replace("\'", "").replace("`", "").trim();
        if (sqlUpdateSetItem.getValue() instanceof SQLVariantRefExpr) {
        } else if (sqlUpdateSetItem.getValue() instanceof SQLValuableExpr) {
        } else {
            throw new UnsupportedOperationException(
                String.format("Do not support complex sql,%s", sqlUpdateSetItem.getClass().toString()));
    return txcTable;
Example 2
Source File:    From dts with Apache License 2.0 5 votes vote down vote up
protected List<Object> getWhereParams(List<Object> sqlParamsList, SQLUpdateStatement parseSqlStatement) {
    if (sqlParamsList != null && !sqlParamsList.isEmpty()) {
        int size = 0;
        for (SQLUpdateSetItem sqlUpdateSetItem : parseSqlStatement.getItems()) {
            if (sqlUpdateSetItem.getValue() instanceof SQLVariantRefExpr) {
        return Lists.newArrayList(sqlParamsList.subList(size, sqlParamsList.size()));
    return Lists.newArrayList();
Example 3
Source File:    From dts with Apache License 2.0 5 votes vote down vote up
protected String selectSql(SQLUpdateStatement mySqlUpdateStatement, Set<String> primaryKeyNameSet) {
    StringBuffer stringBuffer = new StringBuffer();
    stringBuffer.append("SELECT ");
    List<SQLUpdateSetItem> items = mySqlUpdateStatement.getItems();
    for (SQLUpdateSetItem sqlUpdateSetItem : items) {
    stringBuffer.append(String.join(",", primaryKeyNameSet));
    stringBuffer.append(" from ").append(mySqlUpdateStatement.getTableName().getSimpleName()).append(" where ");
    return stringBuffer.toString();