Skip to content

Commit

Permalink
feat: add condition to group field analyzer
Browse files Browse the repository at this point in the history
Signed-off-by: Otavio Santana <otaviopolianasantana@gmail.com>
  • Loading branch information
otaviojava committed Mar 16, 2024
1 parent e7bcdc4 commit e634fb7
Showing 1 changed file with 2 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,26 +210,10 @@ private Mustache createTemplate(String template) {
}


private static MappingType of(TypeMirror type, String collection, String fieldType) {

if (type.getAnnotation(Embeddable.class) != null) {
return MappingType.EMBEDDED;
}
if (type.getAnnotation(Entity.class) != null) {
return MappingType.ENTITY;
}
if (!collection.equals(CollectionUtil.DEFAULT)) {
return MappingType.COLLECTION;
}
if (fieldType.equals("java.util.Map")) {
return MappingType.MAP;
}
return MappingType.DEFAULT;
}

private static MappingType of(Element element, String collection, String fieldType) {
if (element.getAnnotation(Embeddable.class) != null) {
return MappingType.EMBEDDED;
var type = element.getAnnotation(Embeddable.class).value();
return Embeddable.EmbeddableType.FLAT.equals(type)? MappingType.EMBEDDED: MappingType.EMBEDDED_GROUP;
}
if (element.getAnnotation(Entity.class) != null) {
return MappingType.ENTITY;
Expand Down

0 comments on commit e634fb7

Please sign in to comment.