Interface UserRepository
- All Known Implementing Classes:
UserRepositoryImpl
public interface UserRepository
Interface for UserRepository.
- Version:
- 0.4.1
- Author:
- Gianlorenzo Martini
-
Method Summary
Modifier and TypeMethodDescriptionInserts an instance of User in the databaseget
(int id) Finds the user identified by id in the databaseboolean
Finds the user identified by compilationCode in the databasegetByCodeEntity
(String code) Finds the user identified by compilationCode in the databasegetByUsername
(String username) Finds the user identified by username in the database
-
Method Details
-
add
Inserts an instance of User in the database- Parameters:
user
- an instance of User- Returns:
- entity of the user in DB
-
get
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
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
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
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:
-