This commit is contained in:
Vincent Guillet
2025-05-23 10:38:13 +02:00
parent 4cc46d7ac3
commit 153380f541
5 changed files with 72 additions and 4 deletions

View File

@@ -47,7 +47,7 @@ public abstract class GenericDaoImpl<T, ID> implements GenericDao<T, ID> {
public void delete(ID id) {
try (Session session = sessionFactory.openSession()) {
session.beginTransaction();
T entity = session.get(entityClass, id);
T entity = session.find(entityClass, id);
if (entity != null) session.remove(entity);
session.getTransaction().commit();
}