new ClassInitializer() {
@Override
void init(AbstractClassMetaData cmd, ForceStoreManager storeManager, ForceManagedConnection mconn)
throws ConnectionException {
TableImpl table = storeManager.getTable(cmd);
table.getMetaData(cmd).emit(storeManager, mconn);
}
} .initialize(fileMD, storeManager);
// now do the writing
try {
storeManager.getSchemaWriter().write(storeManager.createConnection());
} catch (Exception e) {
if (e instanceof RuntimeException) {
throw (RuntimeException) e;
} else {
throw new NucleusException(e.getMessage(), e);
}
}
// Reload new metadata
new ClassInitializer() {
@Override
void init(AbstractClassMetaData cmd, ForceStoreManager storeManager, ForceManagedConnection mconn)
throws ConnectionException {
TableImpl table = storeManager.getTable(cmd);
if (!table.isValid()) {
table.refresh(null, mconn);
}
}
} .initialize(fileMD, storeManager);
for (FileMetaData md : fileMD) {