summaryrefslogtreecommitdiff
path: root/container-compiler-plugin/src
diff options
context:
space:
mode:
Diffstat (limited to 'container-compiler-plugin/src')
-rw-r--r--container-compiler-plugin/src/main/java/io/trygvis/container/compiler/EntityHandler.java4
-rw-r--r--container-compiler-plugin/src/main/java/io/trygvis/container/compiler/model/ClassG.java4
2 files changed, 5 insertions, 3 deletions
diff --git a/container-compiler-plugin/src/main/java/io/trygvis/container/compiler/EntityHandler.java b/container-compiler-plugin/src/main/java/io/trygvis/container/compiler/EntityHandler.java
index 9bce51e..1dbc534 100644
--- a/container-compiler-plugin/src/main/java/io/trygvis/container/compiler/EntityHandler.java
+++ b/container-compiler-plugin/src/main/java/io/trygvis/container/compiler/EntityHandler.java
@@ -261,8 +261,8 @@ public class EntityHandler extends AbstractHandler {
String desc = "new " + sqlEntityDescType + "(" +
toJavaString(entityMirror.tableName) + ", " +
toJavaString(entityMirror.defaultFields()) + ", " +
- toJavaString(createTableSql.name) + ", " +
- toJavaString(dropTableSql.name) +
+ createTableSql.name + ", " +
+ dropTableSql.name +
")";
g.addPublicStaticFinalField(sqlEntityDescType, "desc").value(desc);
ClassG.InnerClassG typedQuery = g.addInnerClass(entityMirror.queryType(g.imports));
diff --git a/container-compiler-plugin/src/main/java/io/trygvis/container/compiler/model/ClassG.java b/container-compiler-plugin/src/main/java/io/trygvis/container/compiler/model/ClassG.java
index 402498c..3aa9c62 100644
--- a/container-compiler-plugin/src/main/java/io/trygvis/container/compiler/model/ClassG.java
+++ b/container-compiler-plugin/src/main/java/io/trygvis/container/compiler/model/ClassG.java
@@ -6,6 +6,7 @@ import javax.annotation.Generated;
import javax.lang.model.type.TypeMirror;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
+import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;
@@ -22,7 +23,8 @@ public class ClassG {
private TypeRef extendsType;
private List<TypeRef> implementsTypes = new ArrayList<>();
public final Imports imports = new Imports();
- private final Set<FieldRef> fields = new TreeSet<>();
+ // Field order is important
+ private final Set<FieldRef> fields = new LinkedHashSet<>();
private final List<MethodRef> methods = new ArrayList<>();
private final List<Constructor> constructors = new ArrayList<>();
private final List<InnerClassG> innerClasses = new ArrayList<>();