summaryrefslogtreecommitdiff
path: root/container-compiler-plugin/src/main/java/io/trygvis/persistence/FieldMirror.java
diff options
context:
space:
mode:
Diffstat (limited to 'container-compiler-plugin/src/main/java/io/trygvis/persistence/FieldMirror.java')
-rw-r--r--container-compiler-plugin/src/main/java/io/trygvis/persistence/FieldMirror.java22
1 files changed, 12 insertions, 10 deletions
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 +
'}';