當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。