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

org.datafx.crud.jpa.JpaUpdateCall Maven / Gradle / Ivy

The newest version!
package org.datafx.crud.jpa;

import org.datafx.util.EntityWithId;

import javax.persistence.EntityManager;
import java.util.function.Supplier;

public class JpaUpdateCall, T> extends JpaCall {

    public JpaUpdateCall(Supplier managerSupplier) {
        super(managerSupplier);
    }

    public JpaUpdateCall(EntityManager manager) {
        this(() -> manager);
    }

    @Override
    public S call(S entity) throws Exception {
        return getManager().merge(entity);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy