本文整理汇总了Java中liquibase.statement.core.CreateIndexStatement.getTableSchemaName方法的典型用法代码示例。如果您正苦于以下问题:Java CreateIndexStatement.getTableSchemaName方法的具体用法?Java CreateIndexStatement.getTableSchemaName怎么用?Java CreateIndexStatement.getTableSchemaName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类liquibase.statement.core.CreateIndexStatement
的用法示例。
在下文中一共展示了CreateIndexStatement.getTableSchemaName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: CreateIndexStatementMSSQL
import liquibase.statement.core.CreateIndexStatement; //导入方法依赖的package包/类
public CreateIndexStatementMSSQL(CreateIndexStatement createIndexStatement, String includedColumns, Integer fillFactor) {
super(createIndexStatement.getIndexName(), createIndexStatement.getTableCatalogName(),
createIndexStatement.getTableSchemaName(), createIndexStatement.getTableName(),
createIndexStatement.isUnique(), createIndexStatement.getAssociatedWith(),
createIndexStatement.getColumns());
if (createIndexStatement.isClustered() != null) {
setClustered(createIndexStatement.isClustered());
}
this.includedColumns = includedColumns;
this.fillFactor = fillFactor;
}
示例2: generateSql
import liquibase.statement.core.CreateIndexStatement; //导入方法依赖的package包/类
public Sql[] generateSql(CreateIndexStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain) {
// Default filter of index creation:
// creation of all indexes with associations are switched off.
List<String> associatedWith = StringUtils.splitAndTrim(statement.getAssociatedWith(), ",");
if (associatedWith != null && (associatedWith.contains(Index.MARK_PRIMARY_KEY) ||
associatedWith.contains(Index.MARK_UNIQUE_CONSTRAINT) ||
associatedWith.contains(Index.MARK_FOREIGN_KEY))) {
return new Sql[0];
}
StringBuilder buffer = new StringBuilder();
buffer.append("CREATE ");
if (statement.isUnique() != null && statement.isUnique()) {
buffer.append("UNIQUE ");
}
buffer.append("INDEX ");
if (statement.getIndexName() != null) {
String indexSchema = statement.getTableSchemaName();
buffer.append(database.escapeIndexName(null, statement.getIndexName())).append(" ");
}
buffer.append("ON ");
buffer.append(database.escapeTableName(statement.getTableSchemaName(), statement.getTableName())).append("(");
Iterator<String> iterator = Arrays.asList(statement.getColumns()).iterator();
while (iterator.hasNext()) {
String column = iterator.next();
buffer.append(database.escapeColumnName(statement.getTableSchemaName(), statement.getTableName(), column));
if (iterator.hasNext()) {
buffer.append(", ");
}
}
buffer.append(")");
if (StringUtils.trimToNull(statement.getTablespace()) != null && database.supportsTablespaces()) {
if (database instanceof MSSQLDatabase || database instanceof SybaseASADatabase) {
buffer.append(" ON ").append(statement.getTablespace());
} else if (database instanceof DB2Database || database instanceof InformixDatabase) {
buffer.append(" IN ").append(statement.getTablespace());
} else {
buffer.append(" TABLESPACE ").append(statement.getTablespace());
}
}
return new Sql[]{new UnparsedSql(buffer.toString())};
}
示例3: CreateIndexWithWhereStatement
import liquibase.statement.core.CreateIndexStatement; //导入方法依赖的package包/类
public CreateIndexWithWhereStatement(final CreateIndexStatement statement, final String where) {
this(statement.getIndexName(), statement.getTableSchemaName(), statement.getTableName(), statement.isUnique(), statement.getAssociatedWith(), statement.getColumns());
m_where = where;
}
示例4: generateSql
import liquibase.statement.core.CreateIndexStatement; //导入方法依赖的package包/类
@Override
public Sql[] generateSql(CreateIndexStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain) {
if (!supports(statement, database)) {
return sqlGeneratorChain.generateSql(statement, database);
}
// Default filter of index creation:
// creation of all indexes with associations are switched off.
List<String> associatedWith = StringUtils.splitAndTrim(statement.getAssociatedWith(), ",");
if (associatedWith != null && (associatedWith.contains(Index.MARK_PRIMARY_KEY) ||
associatedWith.contains(Index.MARK_UNIQUE_CONSTRAINT) ||
associatedWith.contains(Index.MARK_FOREIGN_KEY))) {
return new Sql[0];
}
StringBuilder buffer = new StringBuilder();
buffer.append("CREATE ");
if (statement.isUnique() != null && statement.isUnique()) {
buffer.append("UNIQUE ");
}
buffer.append("INDEX ");
if (statement.getIndexName() != null) {
String indexSchema = statement.getTableSchemaName();
// buffer.append(database.escapeIndexName(null, statement.getIndexName())).append(" ");
buffer.append(database.escapeIndexName(statement.getTableCatalogName(), indexSchema, statement.getIndexName())).append(" ");
}
buffer.append("ON ");
buffer.append(database.escapeTableName(statement.getTableCatalogName(), statement.getTableSchemaName(), statement.getTableName())).append(" (");
Iterator<AddColumnConfig> iterator = Arrays.asList(statement.getColumns()).iterator();
while (iterator.hasNext()) {
AddColumnConfig column = iterator.next();
buffer.append(database.escapeColumnName(statement.getTableCatalogName(), statement.getTableSchemaName(), statement.getTableName(), column.getName()));
if (iterator.hasNext()) {
buffer.append(", ");
}
}
buffer.append(")");
// return new Sql[]{new UnparsedSql(buffer.toString())};
return new Sql[]{new UnparsedSql(buffer.toString(), getAffectedIndex(statement))};
}