Skip to content

ystankevych/24-hibernate-user-service

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hibernate - create User service

We will continue working on our Cinema project.

Your task is to implement the following steps:

  • Create models:

    • User
  • Create DAO:

    • UserDAO
  • Create service:

    • UserService:

      public interface UserService {
          User add(User user);
      
          Optional<User> findByEmail(String email); // we will use this `Optional` later
      }
    • AuthenticationService

      public interface AuthenticationService {
          User login(String email, String password) throws AuthenticationException;
      
          /**
          * We should register a new user. New user entity will contains the email and password
          * @param email - user email. should be unique for each user
          * @param password - user password
          * @return new user instance
          */
          User register(String email, String password) throws RegistrationException;
      }
    • Create your own checked RegistrationException and AuthenticationException to use it in register() and login() methods respectively

    • Please don’t forget to use salt and password hashing

  • In the mate/academy/Main.main() method create instance of AuthenticationService using injector and test all methods from it.

Try to avoid these common mistakes, while solving task

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%