Skip to content

MaxSkory/hibernate-relations-hw

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hibernate relations

Intro

In this HW you will have the following structure in DAO implementations:

public class ActorDaoImpl extends AbstractDao implements ActorDao {
    public ActorDaoImpl(SessionFactory sessionFactory) {
        super(sessionFactory);
    }
}

Such structure is a good example of Dependency Injection implementation. Please, do not modify this. And thus in methods add(Entity entity) and get(Long id) of DAO layer you need just to refer to the SessionFactory instance of the parent AbstractDao class:

public Entity add(Entity entity) {
    Session session = null;
    Transaction transaction = null;
    try {
        session = factory.openSession();
        transaction = ...

Requirements

Your task is to implement the following steps:

  • add required hibernate dependencies
  • complete implementation of all classes in the mate/academy/hibernate/relations/model package
  • complete implementation of all classes in the mate/academy/hibernate/relations/dao/impl package
  • create your custom unchecked DataProcessingException and throw it in the catch block on dao layer
  • complete implementation of all classes in the mate/academy/hibernate/relations/service/impl/ package
  • create hibernate.cfg.xml file and implement mate/academy/hibernate/relations/util/HibernateUtil class (this is required for next step)
  • make mate/academy/Main.java work (you should be able to run main() method without any errors)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%