Mapper.getConfiguration().setMatchingStrategy(STRICT);

This commit is contained in:
Michael Hoennig 2024-09-25 11:30:54 +02:00
parent fdbe46311a
commit 4acd8a7d65

View File

@ -1,8 +1,6 @@
package net.hostsharing.hsadminng.mapper;
import org.modelmapper.ModelMapper;
import org.modelmapper.convention.MatchingStrategies;
import org.modelmapper.spi.MatchingStrategy;
import org.springframework.util.ReflectionUtils;
import jakarta.persistence.EntityManager;
@ -10,8 +8,6 @@ import jakarta.persistence.ManyToOne;
import jakarta.persistence.PersistenceContext;
import jakarta.validation.ValidationException;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.function.BiConsumer;
import java.util.stream.Collectors;
@ -30,9 +26,7 @@ public class Mapper extends ModelMapper {
EntityManager em;
public Mapper() {
getConfiguration().setAmbiguityIgnored(true);
// getConfiguration().setMatchingStrategy(STRICT);
// getConfiguration().setDeepCopyEnabled(true);
getConfiguration().setMatchingStrategy(STRICT);
}
public <S, T> List<T> mapList(final List<S> source, final Class<T> targetClass) {