Skip to content

Commit

Permalink
dev check-in to start getStringValues(), the reverse of getObjectValu…
Browse files Browse the repository at this point in the history
…es()
  • Loading branch information
erilong committed Apr 11, 2012
1 parent 670ff11 commit 1ad050a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Expand Up @@ -47,6 +47,7 @@
import org.jumpmind.db.sql.DmlStatement;
import org.jumpmind.db.sql.DmlStatement.DmlType;
import org.jumpmind.db.sql.ISqlTemplate;
import org.jumpmind.db.sql.Row;
import org.jumpmind.db.sql.SqlScript;
import org.jumpmind.db.util.BinaryEncoding;
import org.jumpmind.exception.IoException;
Expand Down Expand Up @@ -383,6 +384,20 @@ public Object[] getObjectValues(BinaryEncoding encoding, String[] values,
return list.toArray();
}

public String[] getStringValues(Column[] metaData, Row row) {
String[] values = new String[metaData.length];
for (int i = 0; i < metaData.length; i++) {
if (metaData[i].isOfTextType()) {
values[i] = row.getString(metaData[i].getName());
} else if (metaData[i].isOfNumericType()) {
values[i] = row.getString(metaData[i].getName());
} else if (metaData[i].isOfBinaryType()) {
values[i] = row.getString(metaData[i].getName());
}
}
return values;
}

public Map<String, String> getSqlScriptReplacementTokens() {
return null;
}
Expand Down
Expand Up @@ -27,6 +27,7 @@
import org.jumpmind.db.model.Table;
import org.jumpmind.db.sql.DmlStatement;
import org.jumpmind.db.sql.ISqlTemplate;
import org.jumpmind.db.sql.Row;
import org.jumpmind.db.sql.DmlStatement.DmlType;
import org.jumpmind.db.util.BinaryEncoding;

Expand Down Expand Up @@ -196,6 +197,8 @@ public Object[] getObjectValues(BinaryEncoding encoding, String[] values,
public Object[] getObjectValues(BinaryEncoding encoding, Table table, String[] columnNames,
String[] values);

public String[] getStringValues(Column[] metaData, Row row);

public Database readDatabaseFromXml(String filePath, boolean alterCaseToMatchDatabaseDefaultCase);

public boolean isLob(int type);
Expand Down

0 comments on commit 1ad050a

Please sign in to comment.