diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2013-08-10 10:32:09 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2013-08-10 10:32:09 +0200 |
commit | 86c174ddf24b3e5ac8c8d45fa4d7dc6c5d5d3a3a (patch) | |
tree | 45c3e4e6aaeed03bb8f1c1f487d81242a8493d2f /container-compiler-plugin/src/main/java/io/trygvis/persistence | |
parent | 30fe316402288ea19a86340d4c869351ce7aa1b1 (diff) | |
download | container-playground-86c174ddf24b3e5ac8c8d45fa4d7dc6c5d5d3a3a.tar.gz container-playground-86c174ddf24b3e5ac8c8d45fa4d7dc6c5d5d3a3a.tar.bz2 container-playground-86c174ddf24b3e5ac8c8d45fa4d7dc6c5d5d3a3a.tar.xz container-playground-86c174ddf24b3e5ac8c8d45fa4d7dc6c5d5d3a3a.zip |
Nits.
Diffstat (limited to 'container-compiler-plugin/src/main/java/io/trygvis/persistence')
-rw-r--r-- | container-compiler-plugin/src/main/java/io/trygvis/persistence/generators/EntityManagerGenerator.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/container-compiler-plugin/src/main/java/io/trygvis/persistence/generators/EntityManagerGenerator.java b/container-compiler-plugin/src/main/java/io/trygvis/persistence/generators/EntityManagerGenerator.java index f524b1a..f621343 100644 --- a/container-compiler-plugin/src/main/java/io/trygvis/persistence/generators/EntityManagerGenerator.java +++ b/container-compiler-plugin/src/main/java/io/trygvis/persistence/generators/EntityManagerGenerator.java @@ -1,6 +1,7 @@ package io.trygvis.persistence.generators; import io.trygvis.container.compiler.SqlUnitModel; +import io.trygvis.container.compiler.model.AnnotationG; import io.trygvis.container.compiler.model.ClassG; import io.trygvis.container.compiler.model.Constructor; import io.trygvis.container.compiler.model.FieldRef; @@ -66,13 +67,12 @@ public class EntityManagerGenerator { List<String> body = new ArrayList<>(); for (EntityMirror entity : unit.getEntities().values()) { body.add("if (klass == " + entity.type.plainName + ".class) {"); - body.add(" @SuppressWarnings(\"unchecked\")"); - body.add(" SqlDao<Id, T> dao = (SqlDao<Id, T>) " + daoFields.get(entity).name + ";"); - body.add(" return (SqlDao<Id, T>) dao;"); + body.add(" return (SqlDao<Id, T>) " + daoFields.get(entity).name + ";"); body.add("}"); } body.add("throw new RuntimeException(\"Type is not a part of this persistence unit: \" + klass);"); - return new MethodRef(PUBLIC, sqlDatoType, "getDao", p, body).typeArgs("Id", "T"); + return new MethodRef(PUBLIC, sqlDatoType, "getDao", p, body).typeArgs("Id", "T"). + annotation(new AnnotationG(new TypeRef(SuppressWarnings.class), "\"unchecked\"")); } /* |