From e1cf8889628d2d31cf7067b8c002f229fc22007d Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sat, 3 Aug 2013 18:00:10 +0200 Subject: wip --- .../java/io/trygvis/persistence/FieldMirror.java | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'container-compiler-plugin/src/main/java/io/trygvis/persistence/FieldMirror.java') diff --git a/container-compiler-plugin/src/main/java/io/trygvis/persistence/FieldMirror.java b/container-compiler-plugin/src/main/java/io/trygvis/persistence/FieldMirror.java index c2e5f35..bf0a0c3 100644 --- a/container-compiler-plugin/src/main/java/io/trygvis/persistence/FieldMirror.java +++ b/container-compiler-plugin/src/main/java/io/trygvis/persistence/FieldMirror.java @@ -1,6 +1,6 @@ package io.trygvis.persistence; -import javax.lang.model.element.VariableElement; +import io.trygvis.container.compiler.model.TypeRef; import static io.trygvis.persistence.FieldMirror.FieldType.PRIMITIVE; import static io.trygvis.persistence.FieldMirror.FieldType.REFERENCE; @@ -10,7 +10,7 @@ import static io.trygvis.persistence.FieldMirror.FieldType.REFERENCE; */ public abstract class FieldMirror { public final FieldType fieldType; - public final VariableElement element; + public final TypeRef type; public final String javaName; public final String sqlName; public final boolean id; @@ -21,9 +21,9 @@ public abstract class FieldMirror { REFERENCE, } - protected FieldMirror(FieldType fieldType, VariableElement element, String javaName, String sqlName, boolean id, boolean notNull) { + protected FieldMirror(FieldType fieldType, TypeRef type, String javaName, String sqlName, boolean id, boolean notNull) { this.fieldType = fieldType; - this.element = element; + this.type = type; this.javaName = javaName; this.sqlName = sqlName; this.id = id; @@ -31,14 +31,15 @@ public abstract class FieldMirror { } public static class PrimitiveFieldMirror extends FieldMirror { - public PrimitiveFieldMirror(VariableElement element, String javaName, String sqlName, boolean id, boolean notNull) { - super(PRIMITIVE, element, javaName, sqlName, id, notNull); + public PrimitiveFieldMirror(TypeRef typeRef, String javaName, String sqlName, boolean id, boolean notNull) { + super(PRIMITIVE, typeRef, javaName, sqlName, id, notNull); } @Override public String toString() { return "PrimitiveFieldMirror{" + - "javaName='" + javaName + '\'' + + "type='" + type + '\'' + + ", javaName='" + javaName + '\'' + ", sqlName='" + sqlName + '\'' + ", notNull=" + notNull + '}'; @@ -46,14 +47,15 @@ public abstract class FieldMirror { } public static class ReferenceFieldMirror extends FieldMirror { - public ReferenceFieldMirror(VariableElement element, String javaName, String sqlName, boolean notNull) { - super(REFERENCE, element, javaName, sqlName, false, notNull); + public ReferenceFieldMirror(TypeRef typeRef, String javaName, String sqlName, boolean notNull) { + super(REFERENCE, typeRef, javaName, sqlName, false, notNull); } @Override public String toString() { return "ReferenceFieldMirror{" + - "javaName='" + javaName + '\'' + + "type='" + type + '\'' + + ", javaName='" + javaName + '\'' + ", sqlName='" + sqlName + '\'' + ", notNull=" + notNull + '}'; -- cgit v1.2.3