aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2015-06-30 11:19:48 -0400
committerJames Moger <james.moger@gitblit.com>2015-06-30 11:19:48 -0400
commitf8e9ed9e35fd8662fa44e537b8e00859c2489c28 (patch)
treefd6317cf156f58b389fd684e6167e815f32031d3
parente6646930a1fb77004a844998b82a4afbf22e118b (diff)
downloadiciql-f8e9ed9e35fd8662fa44e537b8e00859c2489c28.tar.gz
iciql-f8e9ed9e35fd8662fa44e537b8e00859c2489c28.zip
Allow construction of Set, List, and Map fields for DataTypeAdapters
-rw-r--r--build.moxie2
-rw-r--r--releases.moxie6
-rw-r--r--src/main/java/com/iciql/util/Utils.java11
3 files changed, 16 insertions, 3 deletions
diff --git a/build.moxie b/build.moxie
index e161bae..c8aac51 100644
--- a/build.moxie
+++ b/build.moxie
@@ -10,7 +10,7 @@ name: Iciql
description: 'a model-based database access wrapper for JDBC'
groupId: com.iciql
artifactId: iciql
-version: 1.7.0-SNAPSHOT
+version: 1.6.4-SNAPSHOT
packaging: jar+zip
inceptionYear: 2011
diff --git a/releases.moxie b/releases.moxie
index f2cf70d..03f2d9e 100644
--- a/releases.moxie
+++ b/releases.moxie
@@ -11,9 +11,11 @@ r28: {
security: ~
fixes: ~
changes: ~
- additions: ~
+ additions:
+ - Support Set, List, and Map types for columns when used with DataTypeAdapter
dependencyChanges: ~
- contributors: ~
+ contributors:
+ - James Moger
}
#
diff --git a/src/main/java/com/iciql/util/Utils.java b/src/main/java/com/iciql/util/Utils.java
index f4dbb81..ada7c34 100644
--- a/src/main/java/com/iciql/util/Utils.java
+++ b/src/main/java/com/iciql/util/Utils.java
@@ -37,7 +37,9 @@ import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.IdentityHashMap;
+import java.util.List;
import java.util.Map;
+import java.util.Set;
import java.util.UUID;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
@@ -191,6 +193,15 @@ public class Utils {
} else if (clazz == java.util.UUID.class) {
COUNTER.getAndIncrement();
return (T) UUID.randomUUID();
+ } else if (Set.class == clazz) {
+ COUNTER.getAndIncrement();
+ return (T) new HashSet();
+ } else if (List.class == clazz) {
+ COUNTER.getAndIncrement();
+ return (T) new ArrayList();
+ } else if (Map.class == clazz) {
+ COUNTER.getAndIncrement();
+ return (T) new HashMap();
}
try {
return clazz.newInstance();