All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.alon.spring.crud.api.configuration.ModelMapperConfiguration Maven / Gradle / Ivy

Go to download

Fornece implementação básica e expansível para criação API's CRUD com Spring Boot e Spring Data JPA.

There is a newer version: 1.0.9
Show newest version
package com.alon.spring.crud.api.configuration;

import org.modelmapper.ModelMapper;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import static org.hibernate.Hibernate.isInitialized;

@Configuration
public class ModelMapperConfiguration {

    @Bean
    public ModelMapper lazyIgnoreModelMapper() {
        ModelMapper modelMapper = new ModelMapper();

        modelMapper.getConfiguration()
                .setPropertyCondition(context -> isInitialized(context.getSource()));

        return modelMapper;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy