Skip to content

Commit

Permalink
feat: remove metadata generator
Browse files Browse the repository at this point in the history
Signed-off-by: Otavio Santana <otaviopolianasantana@gmail.com>
  • Loading branch information
otaviojava committed Jul 30, 2023
1 parent 6eda48b commit 7115a90
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 67 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import jakarta.inject.Inject;
import org.eclipse.jnosql.mapping.Convert;

import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.util.Collections;
import java.util.HashMap;
Expand All @@ -38,16 +39,13 @@ class ClassConverter {
private static final Logger LOGGER = Logger.getLogger(ClassConverter.class.getName());

private Reflections reflections;
private InstanceSupplierFactory instanceSupplierFactory;

private ConstructorMetadataBuilder constructorMetadataBuilder;


@Inject
ClassConverter(Reflections reflections) {

this.reflections = reflections;
this.instanceSupplierFactory = new ReflectionInstanceSupplierFactory(reflections);
this.constructorMetadataBuilder = new ConstructorMetadataBuilder(reflections);
}

Expand All @@ -71,7 +69,9 @@ public EntityMetadata create(Class<?> entity) {
.collect(collectingAndThen(toMap(FieldMapping::name,
Function.identity()), Collections::unmodifiableMap));

InstanceSupplier instanceSupplier = instanceSupplierFactory.apply(reflections.getConstructor(entity));

Constructor<?> constructor = reflections.getConstructor(entity);
InstanceSupplier instanceSupplier = () -> reflections.newInstance(constructor);
InheritanceMetadata inheritance = reflections.getInheritance(entity).orElse(null);
boolean hasInheritanceAnnotation = reflections.hasInheritanceAnnotation(entity);

Expand Down

This file was deleted.

This file was deleted.

0 comments on commit 7115a90

Please sign in to comment.