summaryrefslogtreecommitdiffstats
path: root/src/main/java/com/iciql/DaoProxy.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/iciql/DaoProxy.java')
-rw-r--r--src/main/java/com/iciql/DaoProxy.java14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/main/java/com/iciql/DaoProxy.java b/src/main/java/com/iciql/DaoProxy.java
index deebeca..34187c4 100644
--- a/src/main/java/com/iciql/DaoProxy.java
+++ b/src/main/java/com/iciql/DaoProxy.java
@@ -193,18 +193,13 @@ final class DaoProxy<X extends Dao> implements InvocationHandler, Dao {
} else {
// query of (array of) standard Java type or a DataTypeAdapter type
- if (adapter != null) {
- DataTypeAdapter<?> dta = Utils.newObject(adapter);
- db.getDialect().registerAdapter(dta);
- }
-
objects = Utils.newArrayList();
ResultSet rs = db.executeQuery(preparedSql.sql, preparedSql.parameters);
try {
while (rs.next()) {
- Object value = db.getDialect().deserialize(rs, 1, returnType);
+ Object value = db.getDialect().deserialize(rs, 1, returnType, adapter);
objects.add(value);
if (!isArray) {
@@ -688,13 +683,8 @@ final class DaoProxy<X extends Dao> implements InvocationHandler, Dao {
typeAdapter = Utils.getDataTypeAdapter(methodArg.getClass().getAnnotations());
}
- if (typeAdapter != null) {
- DataTypeAdapter<?> dta = Utils.newObject(typeAdapter);
- db.getDialect().registerAdapter(dta);
- }
-
// prepare the parameter
- parameters[i] = db.getDialect().serialize(value);
+ parameters[i] = db.getDialect().serialize(value, typeAdapter);
}