summaryrefslogtreecommitdiff
path: root/container-compiler-plugin/src/main/java/io/trygvis/persistence/GeneratorConfiguration.java
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2013-08-04 19:14:14 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2013-08-04 19:14:14 +0200
commitf0a9ad191465bba0e7ddaea700d9667be699fec3 (patch)
tree2ae22c719da1a690d44d7397547105bd9ea6e52b /container-compiler-plugin/src/main/java/io/trygvis/persistence/GeneratorConfiguration.java
parent6d4c6960e69b53c124bd84beb3d008bd5a4bb319 (diff)
downloadcontainer-playground-f0a9ad191465bba0e7ddaea700d9667be699fec3.tar.gz
container-playground-f0a9ad191465bba0e7ddaea700d9667be699fec3.tar.bz2
container-playground-f0a9ad191465bba0e7ddaea700d9667be699fec3.tar.xz
container-playground-f0a9ad191465bba0e7ddaea700d9667be699fec3.zip
wip
o Adding support for int and long types.
Diffstat (limited to 'container-compiler-plugin/src/main/java/io/trygvis/persistence/GeneratorConfiguration.java')
-rw-r--r--container-compiler-plugin/src/main/java/io/trygvis/persistence/GeneratorConfiguration.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/container-compiler-plugin/src/main/java/io/trygvis/persistence/GeneratorConfiguration.java b/container-compiler-plugin/src/main/java/io/trygvis/persistence/GeneratorConfiguration.java
index 9df6c35..48072de 100644
--- a/container-compiler-plugin/src/main/java/io/trygvis/persistence/GeneratorConfiguration.java
+++ b/container-compiler-plugin/src/main/java/io/trygvis/persistence/GeneratorConfiguration.java
@@ -3,6 +3,7 @@ package io.trygvis.persistence;
import io.trygvis.container.compiler.CompilerException;
import io.trygvis.container.compiler.model.TypeRef;
+import java.sql.Types;
import java.util.Date;
import java.util.Map;
import java.util.TreeMap;
@@ -13,8 +14,10 @@ public class GeneratorConfiguration {
private final Map<TypeRef, TypeHandler> typeHandlers = new TreeMap<>();
{
- typeHandlers.put(new TypeRef(Integer.class), new TypeHandler.IntTypeHandler());
- typeHandlers.put(new TypeRef(Long.class), new TypeHandler.LongTypeHandler());
+ typeHandlers.put(new TypeRef(int.class), new TypeHandler.PrimitiveTypeHandler("INTEGER", Types.INTEGER, "Int", false));
+ typeHandlers.put(new TypeRef(Integer.class), new TypeHandler.PrimitiveTypeHandler("INTEGER", Types.INTEGER, "Int", true));
+ typeHandlers.put(new TypeRef(long.class), new TypeHandler.PrimitiveTypeHandler("BIGINT", Types.BIGINT, "Long", false));
+ typeHandlers.put(new TypeRef(Long.class), new TypeHandler.PrimitiveTypeHandler("BIGINT", Types.BIGINT, "Long", true));
typeHandlers.put(new TypeRef(String.class), new TypeHandler.StringTypeHandler());
typeHandlers.put(new TypeRef(Date.class), new TypeHandler.DateTypeHandler());
typeHandlers.put(new TypeRef("org.joda.time.DateTime"), new TypeHandler.JodaDateTimeTypeHandler());