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


Java StringUtils.join方法代码示例

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


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

示例1: generateSql

import liquibase.util.StringUtils; //导入方法依赖的package包/类
public Sql[] generateSql(SelectFromDatabaseChangeLogLockStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain) {
  	String liquibaseSchema;
 		liquibaseSchema = database.getLiquibaseSchemaName();

String[] columns = statement.getColumnsToSelect();
int numberOfColumns = columns.length;
String[] escapedColumns = new String[numberOfColumns];
for (int i=0; i<numberOfColumns; i++) {
	escapedColumns[i] = database.escapeColumnName(liquibaseSchema, database.getDatabaseChangeLogLockTableName(), columns[i]);
}

      String sql = "SELECT " + StringUtils.join(escapedColumns, ",") + " FROM " +
              database.escapeTableName(liquibaseSchema, database.getDatabaseChangeLogLockTableName()) +
              " WHERE " + database.escapeColumnName(liquibaseSchema, database.getDatabaseChangeLogLockTableName(), "ID") + "=1";

      if (database instanceof OracleDatabase) {
          sql += " FOR UPDATE";
      }
      return new Sql[] {
              new UnparsedSql(sql)
      };
  }
 
开发者ID:hongliangpan,项目名称:manydesigns.cn,代码行数:23,代码来源:SelectFromDatabaseChangeLogLockGenerator.java

示例2: execute

import liquibase.util.StringUtils; //导入方法依赖的package包/类
public Object execute(StatementCallback action, List<SqlVisitor> sqlVisitors) throws DatabaseException {
    DatabaseConnection con = database.getConnection();
    Statement stmt = null;
    try {
        stmt = ((JdbcConnection) con).getUnderlyingConnection().createStatement();
        Statement stmtToUse = stmt;

        return action.doInStatement(stmtToUse);
    }
    catch (SQLException ex) {
        // Release Connection early, to avoid potential connection pool deadlock
        // in the case when the exception translator hasn't been initialized yet.
        JdbcUtils.closeStatement(stmt);
        stmt = null;
        throw new DatabaseException("Error executing SQL " + StringUtils.join(applyVisitors(action.getStatement(), sqlVisitors), "; on "+ con.getURL())+": "+ex.getMessage(), ex);
    }
    finally {
        JdbcUtils.closeStatement(stmt);
    }
}
 
开发者ID:hongliangpan,项目名称:manydesigns.cn,代码行数:21,代码来源:JdbcExecutor.java

示例3: generateSql

import liquibase.util.StringUtils; //导入方法依赖的package包/类
public Sql[] generateSql(SelectFromDatabaseChangeLogLockStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain) {
  	String liquibaseSchema;
 		liquibaseSchema = database.getLiquibaseSchemaName();

String[] columns = statement.getColumnsToSelect();

      String sql = "SELECT " + StringUtils.join(columns, ",") + " FROM " +
              database.escapeTableName(liquibaseSchema, database.getDatabaseChangeLogLockTableName()) +
              " WHERE ID = 1";

      if (database instanceof OracleDatabase) {
          sql += " FOR UPDATE";
      }
      return new Sql[] {
              new UnparsedSql(sql)
      };
  }
 
开发者ID:hongliangpan,项目名称:manydesigns.cn,代码行数:18,代码来源:PortofinoSelectFromDatabaseChangeLogLockGenerator.java

示例4: toString

import liquibase.util.StringUtils; //导入方法依赖的package包/类
@Override
public String toString() {
    String description;
    if (loader instanceof URLClassLoader) {
        List<String> urls = new ArrayList<String>();
        for (URL url : ((URLClassLoader) loader).getURLs()) {
            urls.add(url.toExternalForm());
        }
        description = StringUtils.join(urls, ",");
    } else {
        description = loader.getClass().getName();
    }
    return getClass().getName()+"("+ description +")";
}
 
开发者ID:hongliangpan,项目名称:manydesigns.cn,代码行数:15,代码来源:CommandLineResourceAccessor.java

示例5: toString

import liquibase.util.StringUtils; //导入方法依赖的package包/类
@Override
public String toString() {
    String description;
    if (classLoader instanceof URLClassLoader) {
        List<String> urls = new ArrayList<String>();
        for (URL url : ((URLClassLoader) classLoader).getURLs()) {
            urls.add(url.toExternalForm());
        }
        description = StringUtils.join(urls, ",");
    } else {
        description = classLoader.getClass().getName();
    }
    return getClass().getName()+"("+ description +")";

}
 
开发者ID:hongliangpan,项目名称:manydesigns.cn,代码行数:16,代码来源:ClassLoaderResourceAccessor.java

示例6: toString

import liquibase.util.StringUtils; //导入方法依赖的package包/类
@Override
public String toString() {
    List<String> openerStrings = new ArrayList<String>();
    for (ResourceAccessor opener : openers ) {
        openerStrings.add(opener.toString());
    }
    return getClass().getName()+"("+StringUtils.join(openerStrings,",")+")";
}
 
开发者ID:hongliangpan,项目名称:manydesigns.cn,代码行数:9,代码来源:CompositeResourceAccessor.java

示例7: getColumnsForUniqueConstraint

import liquibase.util.StringUtils; //导入方法依赖的package包/类
protected void getColumnsForUniqueConstraint(Database database, long conrelid, Array keys, UniqueConstraint constraint) throws SQLException {
    HashMap<Integer, String> columns_map = new HashMap<Integer, String>();
    PreparedStatement stmt = null;
    ResultSet rs = null;
    try {
        String str = null;
        Object arrays = keys.getArray();
        if (arrays instanceof Integer[]) {
            str = StringUtils.join((Integer[])arrays, ",");
        } else if (arrays instanceof int[]) {
            str = StringUtils.join((int[])arrays, ",");
        } else {
            throw new SQLException("Can't detect type of array " + arrays);
        }
        stmt = ((JdbcConnection) database.getConnection()).getUnderlyingConnection().prepareStatement("select attname,attnum from pg_attribute where attrelid = ? and attnum in (" + str + ")");
        stmt.setLong(1, conrelid);
        rs = stmt.executeQuery();
        while (rs.next()) {
            columns_map.put(rs.getInt("attnum"), rs.getString("attname"));
        }
        StringTokenizer str_token = new StringTokenizer(keys.toString().replace("{", "").replace("}", ""), ",");
        while (str_token.hasMoreTokens()) {
            Integer column_id = new Integer(str_token.nextToken());
            constraint.getColumns().add(columns_map.get(column_id));
        }
    }
    finally {
        if (rs != null) {
            try {
                rs.close();
            } catch (SQLException ignored) { }
        }
        if (stmt != null)
            stmt.close();
    }
}
 
开发者ID:hongliangpan,项目名称:manydesigns.cn,代码行数:37,代码来源:PostgresDatabaseSnapshotGenerator.java

示例8: getConfirmationMessage

import liquibase.util.StringUtils; //导入方法依赖的package包/类
public String getConfirmationMessage() {
    List<String> names = new ArrayList<String>(columns.size());
    for (ColumnConfig col : columns) {
        names.add(col.getName() + "(" + col.getType() + ")");
    }

    return "Columns " + StringUtils.join(names, ",") + " added to " + tableName;
}
 
开发者ID:hongliangpan,项目名称:manydesigns.cn,代码行数:9,代码来源:AddColumnChange.java

示例9: getColumnNames

import liquibase.util.StringUtils; //导入方法依赖的package包/类
public String getColumnNames() {
	return StringUtils.join(columns, ", ");
}
 
开发者ID:hongliangpan,项目名称:manydesigns.cn,代码行数:4,代码来源:UniqueConstraint.java

示例10: getColumnNames

import liquibase.util.StringUtils; //导入方法依赖的package包/类
public String getColumnNames() {
    return StringUtils.join(columns, ", ");
}
 
开发者ID:hongliangpan,项目名称:manydesigns.cn,代码行数:4,代码来源:Index.java

示例11: getAssociatedWithAsString

import liquibase.util.StringUtils; //导入方法依赖的package包/类
public String getAssociatedWithAsString() {
	return StringUtils.join(associatedWith, ",");
}
 
开发者ID:hongliangpan,项目名称:manydesigns.cn,代码行数:4,代码来源:Index.java

示例12: getColumnNames

import liquibase.util.StringUtils; //导入方法依赖的package包/类
public String getColumnNames() {
    return StringUtils.join(columnNames, ", ");
}
 
开发者ID:hongliangpan,项目名称:manydesigns.cn,代码行数:4,代码来源:PrimaryKey.java

示例13: getCommandString

import liquibase.util.StringUtils; //导入方法依赖的package包/类
private String getCommandString() {
    return executable + " " + StringUtils.join(args, " ");
}
 
开发者ID:hongliangpan,项目名称:manydesigns.cn,代码行数:4,代码来源:ExecuteShellCommandChange.java


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