io.rtdi.hanaappserver.utils.InstallerStatement Maven / Gradle / Ivy
package io.rtdi.hanaappserver.utils;
public class InstallerStatement {
private InstallType type;
private InstallObject installobject;
private InstallErrorBehavior errorbehavior;
private String sql;
public InstallerStatement(InstallType type, InstallObject installobject, InstallErrorBehavior errorbehavior, String sql) {
this.type = type;
this.installobject = installobject;
this.errorbehavior = errorbehavior;
this.sql = sql;
}
public InstallType getType() {
return type;
}
public InstallObject getInstallObject() {
if (installobject == null) {
return InstallObject.NO_OBJECT;
} else {
return installobject;
}
}
public InstallErrorBehavior getErrorbehavior() {
return errorbehavior;
}
public String getSql() {
return sql;
}
@Override
public String toString() {
String conditiontext = "";
if (installobject != null) {
switch (installobject.getCondition()) {
case IFEXISTS:
conditiontext = "IF EXISTS ";
break;
case IFNOTEXISTS:
conditiontext = "IF NOT EXISTS ";
break;
default:
break;
}
}
return conditiontext + sql;
}
}