mirror of
https://github.com/Athou/commafeed.git
synced 2026-11-20 10:43:37 +00:00
remove deprecated usage of saveOrUpdate in preparation of hibernate 7
This commit is contained in:
@@ -5,7 +5,6 @@ import java.util.Collection;
|
||||
|
||||
import jakarta.persistence.EntityManager;
|
||||
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.jpa.SpecHints;
|
||||
|
||||
import com.commafeed.backend.model.AbstractModel;
|
||||
@@ -35,15 +34,6 @@ public abstract class GenericDAO<T extends AbstractModel> {
|
||||
return new JPADeleteClause(entityManager, entityPath);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public void saveOrUpdate(T model) {
|
||||
entityManager.unwrap(Session.class).saveOrUpdate(model);
|
||||
}
|
||||
|
||||
public void saveOrUpdate(Collection<T> models) {
|
||||
models.forEach(this::saveOrUpdate);
|
||||
}
|
||||
|
||||
public void persist(T model) {
|
||||
entityManager.persist(model);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user