Skip to content

Commit

Permalink
feat: create fieldl analizer and fix for array
Browse files Browse the repository at this point in the history
Signed-off-by: Otavio Santana <otaviopolianasantana@gmail.com>
  • Loading branch information
otaviojava committed Aug 14, 2024
1 parent 98a695f commit e7bc681
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@
package org.eclipse.jnosql.lite.mapping.entities;

import jakarta.nosql.Entity;
import jakarta.nosql.Id;

import jakarta.nosql.Column;
import jakarta.nosql.Entity;
import jakarta.nosql.Convert;

@Entity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,18 +145,23 @@ private FieldModel getMetaData() {

} else if (typeMirror instanceof ArrayType arrayType) {
TypeMirror componentType = arrayType.getComponentType();
mappingType = MappingType.ARRAY;
className = typeMirror.toString();
collectionInstance = CollectionUtil.DEFAULT;

if (componentType instanceof DeclaredType declaredType) {
var element = declaredType.asElement();
className = typeMirror.toString();
supplierElement = componentType.toString();
embeddable = element.getAnnotation(Entity.class) != null || element.getAnnotation(Embeddable.class) != null;
collectionInstance = CollectionUtil.DEFAULT;
elementType = element + ".class";
arrayElement = element.toString();
mappingType = MappingType.ARRAY;
newArrayInstance = className.replace("[]", "[collection.size()]");
} else {
className = componentType.toString();
className = typeMirror.toString();
supplierElement = typeMirror.toString();
arrayElement = componentType.toString();
elementType = componentType + ".class";
newArrayInstance = className.replace("[]", "[collection.size()]");
}
} else {
className = typeMirror.toString();
Expand Down

0 comments on commit e7bc681

Please sign in to comment.