mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-17 21:15:50 +00:00
fix delete() method in JpaVisitRepositoryExtImpl
This commit is contained in:
parent
720448b506
commit
af91fbd24d
1 changed files with 2 additions and 1 deletions
|
@ -32,7 +32,8 @@ public class JpaVisitRepositoryExtImpl extends JpaVisitRepositoryImpl implements
|
|||
|
||||
@Override
|
||||
public void delete(Visit visit) throws DataAccessException {
|
||||
this.em.remove(this.em.contains(visit) ? visit : this.em.merge(visit));
|
||||
String visitId = visit.getId().toString();
|
||||
this.em.createQuery("DELETE FROM Visit visit WHERE id=" + visitId).executeUpdate();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue