]> source.dussan.org Git - iciql.git/commitdiff
Allow construction of Set, List, and Map fields for DataTypeAdapters
authorJames Moger <james.moger@gitblit.com>
Tue, 30 Jun 2015 15:19:48 +0000 (11:19 -0400)
committerJames Moger <james.moger@gitblit.com>
Tue, 30 Jun 2015 15:19:48 +0000 (11:19 -0400)
build.moxie
releases.moxie
src/main/java/com/iciql/util/Utils.java

index e161baef19bcf3f3878214675dc96fcae02c4a76..c8aac5197837127fc2b9423be3097249e6a1cf52 100644 (file)
@@ -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
 
index f2cf70d08e0126beef89dfaa1ba5ba8f747c7f4d..03f2d9e43cf117a10d6c592ec5e65edc0284f0a0 100644 (file)
@@ -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
 }
 
 #
index f4dbb816928de88fa306d5b815f2c735fd7db700..ada7c3486bf362567c3f690d449176fd013fe018 100644 (file)
@@ -37,7 +37,9 @@ import java.util.Date;
 import java.util.HashMap;\r
 import java.util.HashSet;\r
 import java.util.IdentityHashMap;\r
+import java.util.List;\r
 import java.util.Map;\r
+import java.util.Set;\r
 import java.util.UUID;\r
 import java.util.concurrent.atomic.AtomicInteger;\r
 import java.util.concurrent.atomic.AtomicLong;\r
@@ -191,6 +193,15 @@ public class Utils {
                } else if (clazz == java.util.UUID.class) {\r
                        COUNTER.getAndIncrement();\r
                        return (T) UUID.randomUUID();\r
+               } else if (Set.class == clazz) {\r
+                       COUNTER.getAndIncrement();\r
+                       return (T) new HashSet();\r
+               } else if (List.class == clazz) {\r
+                       COUNTER.getAndIncrement();\r
+                       return (T) new ArrayList();\r
+               } else if (Map.class == clazz) {\r
+                       COUNTER.getAndIncrement();\r
+                       return (T) new HashMap();\r
                }\r
                try {\r
                        return clazz.newInstance();\r