From f50cd0bc4b8a29992c97194c427f6f8c7fa78b4d Mon Sep 17 00:00:00 2001 From: stvort Date: Wed, 13 Mar 2024 22:11:06 +0400 Subject: [PATCH] 2024-01 spring-11-jpql fix --- .../ormdemo/repositories/OtusStudentRepositoryJpaTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/2024-01/spring-11-jpql/jpql-class-work/jpql-solution-03/src/test/java/ru/otus/example/ormdemo/repositories/OtusStudentRepositoryJpaTest.java b/2024-01/spring-11-jpql/jpql-class-work/jpql-solution-03/src/test/java/ru/otus/example/ormdemo/repositories/OtusStudentRepositoryJpaTest.java index 027b8239..28dddcea 100644 --- a/2024-01/spring-11-jpql/jpql-class-work/jpql-solution-03/src/test/java/ru/otus/example/ormdemo/repositories/OtusStudentRepositoryJpaTest.java +++ b/2024-01/spring-11-jpql/jpql-class-work/jpql-solution-03/src/test/java/ru/otus/example/ormdemo/repositories/OtusStudentRepositoryJpaTest.java @@ -103,7 +103,7 @@ class OtusStudentRepositoryJpaTest { void shouldUpdateStudentNameById() { val firstStudent = em.find(OtusStudent.class, FIRST_STUDENT_ID); String oldName = firstStudent.getName(); - //em.detach(firstStudent); + em.detach(firstStudent); repositoryJpa.updateNameById(FIRST_STUDENT_ID, STUDENT_NAME); val updatedStudent = em.find(OtusStudent.class, FIRST_STUDENT_ID); @@ -117,7 +117,7 @@ class OtusStudentRepositoryJpaTest { void shouldDeleteStudentNameById() { val firstStudent = em.find(OtusStudent.class, FIRST_STUDENT_ID); assertThat(firstStudent).isNotNull(); - //em.detach(firstStudent); + em.detach(firstStudent); repositoryJpa.deleteById(FIRST_STUDENT_ID); val deletedStudent = em.find(OtusStudent.class, FIRST_STUDENT_ID);