}
if (foundObject instanceof Schema) {
Schema schema = (Schema) foundObject;
HibernateDatabase database = (HibernateDatabase) snapshot.getDatabase();
Configuration cfg = database.getConfiguration();
Iterator<org.hibernate.mapping.Table> tableMappings = cfg.getTableMappings();
while (tableMappings.hasNext()) {
org.hibernate.mapping.Table hibernateTable = (org.hibernate.mapping.Table) tableMappings.next();
if (hibernateTable.isPhysicalTable()) {
Table table = new Table().setName(hibernateTable.getName());
table.setSchema(schema);
LOG.info("Found table " + table.getName());
schema.addDatabaseObject(snapshotObject(table, snapshot));
}
}
Iterator<PersistentClass> classMappings = cfg.getClassMappings();
while (classMappings.hasNext()) {
PersistentClass persistentClass = (PersistentClass) classMappings
.next();
if (!persistentClass.isInherited()) {
IdentifierGenerator ig = persistentClass.getIdentifier().createIdentifierGenerator(
cfg.getIdentifierGeneratorFactory(),
database.getDialect(),
null,
null,
(RootClass) persistentClass
);
for (ExtendedSnapshotGenerator<IdentifierGenerator, Table> tableIdGenerator : tableIdGenerators) {