package io.trygvis.persistence; import io.trygvis.container.compiler.model.TypeRef; /** * TODO: a single field might have to be mapped to multiple sql columns. */ public class FieldMirror { public final FieldType fieldType; public final AccessorType accessorType; public final TypeRef type; public final String javaName; public final String sqlName; public final boolean id; public final boolean notNull; public final boolean unique; public enum FieldType { PRIMITIVE, REFERENCE, } public enum AccessorType { FIELD, METHOD, } public FieldMirror(FieldType fieldType, AccessorType accessorType, TypeRef type, String javaName, String sqlName, boolean id, boolean notNull, boolean unique) { this.fieldType = fieldType; this.accessorType = accessorType; this.type = type; this.javaName = javaName; this.sqlName = sqlName; this.id = id; this.notNull = notNull; this.unique = unique; } @Override public String toString() { return "FieldMirror{" + "fieldType=" + fieldType + ", accessorType=" + accessorType + ", type=" + type + ", javaName='" + javaName + '\'' + ", sqlName='" + sqlName + '\'' + ", id=" + id + ", notNull=" + notNull + ", unique=" + unique + '}'; } }