remove deprecated usage of saveOrUpdate in preparation of hibernate 7

This commit is contained in:
Athou
2025-06-13 07:33:51 +02:00
parent f2c0d99bd9
commit d46ee7f673
12 changed files with 24 additions and 44 deletions

View File

@@ -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);
}