Hibernate

We are starting working with Hibernate on the new project. We will implement it step by step. Completed structure of project is described below: pic

Your task is to implement the following steps:

  • add required hibernate dependencies
  • create hibernate.cfg.xml file
  • create HibernateUtil class
  • create Movie model class
  • create MovieDao interface and MovieDaoImpl class
      public interface MovieDao {
          Movie add(Movie movie);
      
          Optional<Movie> get(Long id);
      }
  • create MovieService interface and MovieServiceImpl class
      public interface MovieService {
          Movie add(Movie movie);
      
          Movie get(Long id);
      }
  • create your custom unchecked DataProcessingException and throw it in the catch block on dao layer
  • in the mate/academy/Main.main() method create instance of MovieService using injector and test all methods from MovieService
  • use annotations and the annotation injector located in the lib folder
  • run tests with command mvn -DskipTests=false clean package.

!!! Important: you should have only Movie model with dao and service layer. Don't create other models and don't push them to PR.