mirror of
https://github.com/kmitresse/Cards-Rush.git
synced 2026-07-09 13:27:45 +00:00
feat(DevWeb): Remove transactions in DAO_JPA_User
This commit is contained in:
@@ -37,7 +37,6 @@ public class DAO_JPA_User extends DAO<User> {
|
|||||||
@Override
|
@Override
|
||||||
public User findById(int id) throws DAOException {
|
public User findById(int id) throws DAOException {
|
||||||
User result = entityManager.find(User.class, new BigDecimal(id));
|
User result = entityManager.find(User.class, new BigDecimal(id));
|
||||||
entityManager.flush();
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,15 +63,11 @@ public class DAO_JPA_User extends DAO<User> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(User data) throws DAOException {
|
public void update(User data) throws DAOException {
|
||||||
entityManager.getTransaction().begin();
|
|
||||||
entityManager.merge(data);
|
entityManager.merge(data);
|
||||||
entityManager.getTransaction().commit();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void delete(User data) throws DAOException {
|
public void delete(User data) throws DAOException {
|
||||||
entityManager.getTransaction().begin();
|
|
||||||
entityManager.remove(data);
|
entityManager.remove(data);
|
||||||
entityManager.getTransaction().commit();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user