From 9501030d021461d68ca96a165576d9b80b8428ed Mon Sep 17 00:00:00 2001 From: pochtalon Date: Tue, 1 Aug 2023 21:45:45 +0300 Subject: [PATCH] Solved --- mem.lck | Bin 16 -> 16 bytes pom.xml | 2 +- src/main/java/mate/academy/dao/MovieDaoImpl.java | 2 +- src/main/java/mate/academy/model/Movie.java | 10 +++++----- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/mem.lck b/mem.lck index b6449be100bcc80c4de69565a08312a28caae684..a4e291c0788b0091b3faadf4fdd962d9202f2661 100644 GIT binary patch literal 16 XcmeYW4)pQyclKsrVC>wK_30u2CtC%} literal 16 XcmeYW4)pQyclKsrVC>v@tzjboCzl1J diff --git a/pom.xml b/pom.xml index 1dcd0b133..f628b0b9c 100644 --- a/pom.xml +++ b/pom.xml @@ -23,7 +23,7 @@ org.hibernate hibernate-core - 5.4.27.Final + 6.2.5.Final mysql diff --git a/src/main/java/mate/academy/dao/MovieDaoImpl.java b/src/main/java/mate/academy/dao/MovieDaoImpl.java index 2f3aca0c5..1c4bef2e3 100644 --- a/src/main/java/mate/academy/dao/MovieDaoImpl.java +++ b/src/main/java/mate/academy/dao/MovieDaoImpl.java @@ -40,7 +40,7 @@ public Optional get(Long id) throws DataProcessingException { Session session = null; try { session = sessionFactory.openSession(); - return Optional.of(session.get(Movie.class, id)); + return Optional.ofNullable(session.get(Movie.class, id)); } catch (Exception e) { throw new DataProcessingException("Something went wrong", e); } finally { diff --git a/src/main/java/mate/academy/model/Movie.java b/src/main/java/mate/academy/model/Movie.java index 22ae14a1c..ffbdcd1bb 100644 --- a/src/main/java/mate/academy/model/Movie.java +++ b/src/main/java/mate/academy/model/Movie.java @@ -1,10 +1,10 @@ package mate.academy.model; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Table; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.Table; @Entity @Table(name = "ticket_app")