diff --git a/mem.lck b/mem.lck index b6449be10..a4e291c07 100644 Binary files a/mem.lck and b/mem.lck differ 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")