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


Java DatabaseObject类代码示例

本文整理汇总了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;

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

示例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);
}
 
开发者ID:hongliangpan,项目名称:manydesigns.cn,代码行数:27,代码来源:UnparsedSql.java

示例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;
	}
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:18,代码来源:CreateIndexWithWhereGenerator.java

示例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>();
}
 
开发者ID:hongliangpan,项目名称:manydesigns.cn,代码行数:13,代码来源:DBDocVisitor.java

示例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;
}
 
开发者ID:hongliangpan,项目名称:manydesigns.cn,代码行数:9,代码来源:AbstractChange.java

示例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;
}
  }
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:16,代码来源:DropForeignKeyConstraintCascadeGenerator.java

示例7: getAffectedDatabaseObjects

import liquibase.database.structure.DatabaseObject; //导入依赖的package包/类
public Collection<? extends DatabaseObject> getAffectedDatabaseObjects() {
	return new HashSet<DatabaseObject>();
}
 
开发者ID:hongliangpan,项目名称:manydesigns.cn,代码行数:4,代码来源:SingleLineComment.java

示例8: getAffectedDatabaseObjects

import liquibase.database.structure.DatabaseObject; //导入依赖的package包/类
public Set<? extends DatabaseObject> getAffectedDatabaseObjects() {
    return affectedDatabaseObjects;
}
 
开发者ID:hongliangpan,项目名称:manydesigns.cn,代码行数:4,代码来源:UnparsedSql.java

示例9: getAffectedDatabaseObjects

import liquibase.database.structure.DatabaseObject; //导入依赖的package包/类
Collection<? extends DatabaseObject> getAffectedDatabaseObjects(); 
开发者ID:hongliangpan,项目名称:manydesigns.cn,代码行数:2,代码来源:Sql.java

示例10: getAffectedDatabaseObjects

import liquibase.database.structure.DatabaseObject; //导入依赖的package包/类
public Set<DatabaseObject> getAffectedDatabaseObjects(Database database); 
开发者ID:hongliangpan,项目名称:manydesigns.cn,代码行数:2,代码来源:Change.java


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