StringBuffer out = new StringBuffer();
Iterator it = variables.iterator();
VariableForImport var;
Vector alternatives = new Vector();
int counter = 0;
Alternative alternative = new Alternative();
while (it.hasNext()) {
counter = 0;
var = (VariableForImport) it.next();
alternatives = var.getAlternatvies();
try {
Class clazz = Class.forName(var.getType());
if (var.getName() != null
&& !var.getName().equals("")
&& alternatives != null
&& var.getTable() != null
&& !var.getTable().equals("")
&& (ListElement.class.isAssignableFrom(clazz))) {
out
.append("insert into listboxtextrow (ID, LISTORDER, LANGUAGEID, TEXT, TEXTVALUE, SELECTED, TSCREATED, TSUPDATED, CREATEDBY, UPDATEDBY, VALIDFROM)");
out.append(" values (");
out.append("'" + var.getTable().toUpperCase() + "_"
+ var.getName().toUpperCase() + "_L' ");
out
.append(", 0, '"
+ var.getLanguageid()
+ "', '', '', 1, localtimestamp,localtimestamp, 'System', 'System', DATE '2004-01-01');");
out.append(nl);
for (int r = 0; r < alternatives.size(); r++) {
counter++;
alternative = (Alternative) alternatives.get(r);
out
.append("insert into listboxtextrow (ID, LISTORDER, LANGUAGEID, TEXT, TEXTVALUE, "
+ "SELECTED, TSCREATED, TSUPDATED, CREATEDBY, UPDATEDBY, VALIDFROM, VALIDTO)");
out.append("values (");
out.append("'" + var.getTable().toUpperCase() + "_"
+ var.getName().toUpperCase() + "_L' ");
out.append(", " + counter);
out.append(", '" + var.getLanguageid());
out
.append("', '"
+ alternative.getText()
+ "', '"
+ alternative.getValue()
+ "', "
+ "0, localtimestamp,localtimestamp, 'System', 'System', DATE '"
+ alternative.getStartDate() + "'");
if (!"".equals(alternative.getEndDate())) {
out.append(", DATE '" + alternative.getEndDate() + "'");
} else {
out.append(", null");
}
out.append(");");