aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/com/iciql/SQLDialectH2.java
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2014-10-29 17:12:14 -0400
committerJames Moger <james.moger@gitblit.com>2014-10-29 17:12:14 -0400
commit8d28bc740c9bcb76186e7572f74a144397e780ce (patch)
tree1815e1d21df77e352ba2e8106557f71cb5561a8e /src/main/java/com/iciql/SQLDialectH2.java
parentbdb2899da4cbb27016d85c5e4fe268ddbccef546 (diff)
downloadiciql-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.java5
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());