io.beanmapper.spring.flusher.JpaAfterClearFlusher Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of beanmapper-spring Show documentation
Show all versions of beanmapper-spring Show documentation
Spring support for the Bean Mapper
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