Skip to content

Nazar090/hibernate-user-service-hw

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 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. The new user entity will contain 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 in register() and login() methods respectively

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

  • In the mate/academy/Main.main() method create an 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%