Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions src/main/java/org/twilmes/sql/gremlin/schema/TableUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,23 @@ public static Object convertType(Object value, TableColumn column) {
case "string":
return value;
case "integer":
return ((Number) value).intValue();
try {
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this is correct way of converting these types, but it works for me so far, same to the rest of changes

return Integer.valueOf(String.valueOf(value));
} catch ( NumberFormatException e ) {
return value;
}
case "long":
return ((Number) value).longValue();
try {
return Long.valueOf(String.valueOf(value));
} catch ( NumberFormatException e ) {
return value;
}
case "double":
return ((Number) value).doubleValue();
try {
return Double.valueOf(String.valueOf(value));
} catch ( NumberFormatException e ) {
return value;
}
case "boolean":
if(value instanceof Number) {
if(value.equals(0)) {
Expand Down