本文整理汇总了Java中liquibase.database.structure.DatabaseObject类的典型用法代码示例。如果您正苦于以下问题:Java DatabaseObject类的具体用法?Java DatabaseObject怎么用?Java DatabaseObject使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DatabaseObject类属于liquibase.database.structure包,在下文中一共展示了DatabaseObject类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAffectedDatabaseObjects
import liquibase.database.structure.DatabaseObject; //导入依赖的package包/类
public Set<DatabaseObject> getAffectedDatabaseObjects(SqlStatement statement, Database database) {
Set<DatabaseObject> affectedObjects = new HashSet<DatabaseObject>();
SqlGeneratorChain sqlGeneratorChain = createGeneratorChain(statement, database);
if (sqlGeneratorChain != null) {
//noinspection unchecked
Sql[] sqls = sqlGeneratorChain.generateSql(statement, database);
if (sqls != null) {
for (Sql sql : sqls) {
affectedObjects.addAll(sql.getAffectedDatabaseObjects());
}
}
}
return affectedObjects;
}
示例2: UnparsedSql
import liquibase.database.structure.DatabaseObject; //导入依赖的package包/类
public UnparsedSql(String sql, String endDelimiter, DatabaseObject... affectedDatabaseObjects) {
this.sql = sql.trim();
this.endDelimiter = endDelimiter;
this.affectedDatabaseObjects.addAll(Arrays.asList(affectedDatabaseObjects));
List<DatabaseObject> moreAffectedDatabaseObjects = new ArrayList<DatabaseObject>();
boolean foundMore = true;
while (foundMore) {
for (DatabaseObject object : this.affectedDatabaseObjects) {
DatabaseObject[] containingObjects = object.getContainingObjects();
if (containingObjects != null) {
for (DatabaseObject containingObject : containingObjects) {
if (containingObject != null && !this.affectedDatabaseObjects.contains(containingObject) && !moreAffectedDatabaseObjects.contains(containingObject)) {
moreAffectedDatabaseObjects.add(containingObject);
}
}
}
}
foundMore = moreAffectedDatabaseObjects.size() > 0;
this.affectedDatabaseObjects.addAll(moreAffectedDatabaseObjects);
moreAffectedDatabaseObjects.clear();
}
this.affectedDatabaseObjects.addAll(moreAffectedDatabaseObjects);
}
示例3: generateSql
import liquibase.database.structure.DatabaseObject; //导入依赖的package包/类
public Sql[] generateSql(final CreateIndexStatement statement, final Database database, final SqlGeneratorChain sqlGeneratorChain) {
final Sql[] superSql = super.generateSql(statement, database, sqlGeneratorChain);
if (statement instanceof CreateIndexWithWhereStatement) {
if (superSql.length != 1) {
LogFactory.getLogger().warning("expected 1 create index statement, but got " + superSql.length);
return superSql;
}
return new Sql[] {
new UnparsedSql(superSql[0].toSql() + " WHERE " + ((CreateIndexWithWhereStatement)statement).getWhere(),
superSql[0].getEndDelimiter(), superSql[0].getAffectedDatabaseObjects().toArray(new DatabaseObject[0]))
};
} else {
return superSql;
}
}
示例4: DBDocVisitor
import liquibase.database.structure.DatabaseObject; //导入依赖的package包/类
public DBDocVisitor(Database database) {
this.database = database;
changesByObject = new HashMap<DatabaseObject, List<Change>>();
changesByAuthor = new HashMap<String, List<Change>>();
changeLogs = new TreeSet<ChangeLogInfo>();
changesToRunByObject = new HashMap<DatabaseObject, List<Change>>();
changesToRunByAuthor = new HashMap<String, List<Change>>();
changesToRun = new ArrayList<Change>();
recentChanges = new ArrayList<Change>();
}
示例5: getAffectedDatabaseObjects
import liquibase.database.structure.DatabaseObject; //导入依赖的package包/类
public Set<DatabaseObject> getAffectedDatabaseObjects(Database database) {
Set<DatabaseObject> affectedObjects = new HashSet<DatabaseObject>();
for (SqlStatement statement : generateStatements(database)) {
affectedObjects.addAll(SqlGeneratorFactory.getInstance().getAffectedDatabaseObjects(statement, database));
}
return affectedObjects;
}
示例6: generateSql
import liquibase.database.structure.DatabaseObject; //导入依赖的package包/类
public Sql[] generateSql(final DropForeignKeyConstraintStatement statement, final Database database, final SqlGeneratorChain sqlGeneratorChain) {
final Sql[] superSql = super.generateSql(statement, database, sqlGeneratorChain);
if (statement instanceof DropForeignKeyConstraintCascadeStatement) {
Boolean cascade = ((DropForeignKeyConstraintCascadeStatement)statement).getCascade();
if (cascade != null && cascade && database instanceof PostgresDatabase) {
return new Sql[] {
new UnparsedSql(superSql[0].toSql() + " CASCADE", superSql[0].getEndDelimiter(), superSql[0].getAffectedDatabaseObjects().toArray(new DatabaseObject[0]))
};
} else {
return superSql;
}
} else {
return superSql;
}
}
示例7: getAffectedDatabaseObjects
import liquibase.database.structure.DatabaseObject; //导入依赖的package包/类
public Collection<? extends DatabaseObject> getAffectedDatabaseObjects() {
return new HashSet<DatabaseObject>();
}
示例8: getAffectedDatabaseObjects
import liquibase.database.structure.DatabaseObject; //导入依赖的package包/类
public Set<? extends DatabaseObject> getAffectedDatabaseObjects() {
return affectedDatabaseObjects;
}
示例9: getAffectedDatabaseObjects
import liquibase.database.structure.DatabaseObject; //导入依赖的package包/类
Collection<? extends DatabaseObject> getAffectedDatabaseObjects();
示例10: getAffectedDatabaseObjects
import liquibase.database.structure.DatabaseObject; //导入依赖的package包/类
public Set<DatabaseObject> getAffectedDatabaseObjects(Database database);