use of org.pentaho.di.trans.steps.synchronizeaftermerge.SynchronizeAfterMergeMeta in project pentaho-kettle by pentaho.
the class SynchronizeAfterMergeDialog method create.
// Generate code for create table...
// Conversions done by Database
private void create() {
try {
SynchronizeAfterMergeMeta info = new SynchronizeAfterMergeMeta();
getInfo(info);
// new name might not yet be linked to other steps!
String name = stepname;
StepMeta stepMeta = new StepMeta(BaseMessages.getString(PKG, "SynchronizeAfterMergeDialog.StepMeta.Title"), name, info);
RowMetaInterface prev = transMeta.getPrevStepFields(stepname);
SQLStatement sql = info.getSQLStatements(transMeta, stepMeta, prev, repository, metaStore);
if (!sql.hasError()) {
if (sql.hasSQL()) {
SQLEditor sqledit = new SQLEditor(transMeta, shell, SWT.NONE, info.getDatabaseMeta(), transMeta.getDbCache(), sql.getSQL());
sqledit.open();
} else {
MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_INFORMATION);
mb.setMessage(BaseMessages.getString(PKG, "SynchronizeAfterMergeDialog.NoSQLNeeds.DialogMessage"));
mb.setText(BaseMessages.getString(PKG, "SynchronizeAfterMergeDialog.NoSQLNeeds.DialogTitle"));
mb.open();
}
} else {
MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_ERROR);
mb.setMessage(sql.getError());
mb.setText(BaseMessages.getString(PKG, "SynchronizeAfterMergeDialog.SQLError.DialogTitle"));
mb.open();
}
} catch (KettleException ke) {
new ErrorDialog(shell, BaseMessages.getString(PKG, "SynchronizeAfterMergeDialog.CouldNotBuildSQL.DialogTitle"), BaseMessages.getString(PKG, "SynchronizeAfterMergeDialog.CouldNotBuildSQL.DialogMessage"), ke);
}
}
Aggregations