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

io.beanmapper.spring.flusher.JpaAfterClearFlusher Maven / Gradle / Ivy

There is a newer version: 6.0.0
Show newest version
package io.beanmapper.spring.flusher;

import javax.persistence.EntityManager;

import io.beanmapper.config.AfterClearFlusher;

/**
 * Specific AfterClearFlusher for flushing JPA's EntityManager. This is called by
 * BeanMapper after calling clear on a collection.
 */
public class JpaAfterClearFlusher implements AfterClearFlusher {

    private final EntityManager entityManager;

    public JpaAfterClearFlusher(EntityManager entityManager) {
        this.entityManager = entityManager;
    }

    @Override
    public void flush() {
        entityManager.flush();
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy