diff options
author | James Moger <james.moger@gitblit.com> | 2014-10-29 17:12:14 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2014-10-29 17:12:14 -0400 |
commit | 8d28bc740c9bcb76186e7572f74a144397e780ce (patch) | |
tree | 1815e1d21df77e352ba2e8106557f71cb5561a8e /src/main/java/com/iciql/SQLDialectH2.java | |
parent | bdb2899da4cbb27016d85c5e4fe268ddbccef546 (diff) | |
download | iciql-8d28bc740c9bcb76186e7572f74a144397e780ce.tar.gz iciql-8d28bc740c9bcb76186e7572f74a144397e780ce.zip |
Support data type adapters
This allows custom types to be (de)serialized into a standard JDBC type or
to support db-specific data types, like the Postgres json and xml types.
Diffstat (limited to 'src/main/java/com/iciql/SQLDialectH2.java')
-rw-r--r-- | src/main/java/com/iciql/SQLDialectH2.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/com/iciql/SQLDialectH2.java b/src/main/java/com/iciql/SQLDialectH2.java index 6b3bab1..2d7d0fd 100644 --- a/src/main/java/com/iciql/SQLDialectH2.java +++ b/src/main/java/com/iciql/SQLDialectH2.java @@ -37,7 +37,7 @@ public class SQLDialectH2 extends SQLDialectDefault { return "CREATE CACHED TABLE IF NOT EXISTS";
}
}
-
+
@Override
protected <T> String prepareCreateView(TableDefinition<T> def) {
return "CREATE VIEW IF NOT EXISTS";
@@ -127,7 +127,8 @@ public class SQLDialectH2 extends SQLDialectDefault { buff.appendExceptFirst(", ");
buff.append('?');
Object value = def.getValue(obj, field);
- stat.addParameter(value);
+ Object parameter = serialize(value, field.typeAdapter);
+ stat.addParameter(parameter);
}
buff.append(')');
stat.setSQL(buff.toString());
|