Interface UserRepository

All Known Implementing Classes:
UserRepositoryImpl

public interface UserRepository
Interface for UserRepository.
Version:
0.4.1
Author:
Gianlorenzo Martini
  • Method Summary

    Modifier and Type
    Method
    Description
    add(User user)
    Inserts an instance of User in the database
    get(int id)
    Finds the user identified by id in the database
    boolean
    Finds the user identified by compilationCode in the database
    Finds the user identified by compilationCode in the database
    Finds the user identified by username in the database
  • Method Details

    • add

      User add(User user)
      Inserts an instance of User in the database
      Parameters:
      user - an instance of User
      Returns:
      entity of the user in DB
    • get

      User get(int id) throws NotFoundException
      Finds the user identified by id in the database
      Parameters:
      id - the id of the user to be found
      Returns:
      an instance of User if there is a user identified by id, null otherwise
      Throws:
      NotFoundException - if no user identified by the id has been found
    • getByCode

      boolean getByCode(String code) throws NotFoundException
      Finds the user identified by compilationCode in the database
      Parameters:
      code - the compilationCode of the user to be found
      Returns:
      an instance of User if there is a user identified by code, null otherwise
      Throws:
      NotFoundException - if no user identified by the id has been found
    • getByUsername

      User getByUsername(String username) throws NotFoundException
      Finds the user identified by username in the database
      Parameters:
      username - the id of the user to be found
      Returns:
      an instance of User if there is a user identified by id, null otherwise
      Throws:
      NotFoundException - if no user identified by the id has been found
    • getByCodeEntity

      User getByCodeEntity(String code) throws NotFoundException
      Finds the user identified by compilationCode in the database
      Parameters:
      code - the code of the user to be found
      Returns:
      an instance of User if there is a user identified by code, null otherwise
      Throws:
      NotFoundException - if no user identified by the id has been found
      See Also: