Skip to content

Commit

Permalink
0003465: DBFill support for JSON types
Browse files Browse the repository at this point in the history
  • Loading branch information
jumpmind-josh committed Mar 1, 2018
1 parent 3bc6488 commit 335d994
Showing 1 changed file with 14 additions and 9 deletions.
Expand Up @@ -784,15 +784,20 @@ private Object generateRandomValueForColumn(Column column) {
} else if (type == Types.ARRAY) {
objectValue = null;
} else if (type == Types.VARCHAR || type == Types.LONGVARCHAR || type == Types.CHAR || type == Types.CLOB) {
int size = 0;
// Assume if the size is 0 there is no max size configured.
if (column.getSizeAsInt() != 0) {
size = column.getSizeAsInt()>50?50:column.getSizeAsInt();
} else {
// No max length so default to 50
size = 50;
}
objectValue = randomString(size);
if (column.getJdbcTypeName() != null && column.getJdbcTypeName().equals("JSON")) {
objectValue = "{\"jumpmind\":\"symmetricds\"}";
}
else {
int size = 0;
// Assume if the size is 0 there is no max size configured.
if (column.getSizeAsInt() != 0) {
size = column.getSizeAsInt()>50?50:column.getSizeAsInt();
} else {
// No max length so default to 50
size = 50;
}
objectValue = randomString(size);
}
} else if (type == Types.OTHER) {
if ("UUID".equalsIgnoreCase(column.getJdbcTypeName())) {
objectValue = randomUUID();
Expand Down

0 comments on commit 335d994

Please sign in to comment.