Interface QuestionRepository
- All Known Implementing Classes:
QuestionRepositoryImpl
public interface QuestionRepository
Interface for QuestionRepository.
- Version:
- 0.4.1
- Author:
- Khalil
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Inserts an instance of Question in the databaseget
(int id) Finds the question identified by id in the databasegetAll()
Finds all the questions in the databasegetAllLazy
(int offset, int limit) Finds all the questions in the database with lazy loadinggetByCategory
(int categoryId) Finds the question identified by id of the category in the databasegetByCategoryLazy
(int categoryId, int offset, int limit) Finds the question identified by id of the category in the database with Lazy Loading parameters:getBySurveyId
(int surveyId) Finds the question identified by id in the databaseFinds the question in the database where text is contained in the text of the questiongetByTextLazy
(String text, int offset, int limit) Finds the question in the database where text is contained in the text of the question with Lazy Loading parameters:offset
andlimit
getByUser
(int userId) Finds the question in the database created by a specified usergetByUserLazy
(int userId, int offset, int limit) Finds the question in the database created by a specified user with Lazy Loading parameters:void
Updates a question in the database using a new instance of Question.void
remove
(int id) Deletes from the database the question identified by id.
-
Method Details
-
add
Inserts an instance of Question in the database- Parameters:
question
- an instance of Question- See Also:
-
get
Finds the question identified by id in the database- Parameters:
id
- the id of the question to be found- Returns:
- an instance of Question if there is a question identified by id, null otherwise
- Throws:
NotFoundException
- if no question identified byid
has been found
-
getAll
Finds all the questions in the database- Returns:
- all the instances of Question, null otherwise
- Throws:
NotFoundException
-
getAllLazy
Finds all the questions in the database with lazy loading- Parameters:
offset
- initial position for the querylimit
- limiting query results- Returns:
- all the instances of Question, null otherwise
-
getBySurveyId
Finds the question identified by id in the database- Parameters:
surveyId
- the id of the question to be found- Returns:
- an instance of Question if there is a question identified by id, null otherwise
-
getByText
Finds the question in the database where text is contained in the text of the question- Parameters:
text
- the text of the question to be found- Returns:
- an instance of Question if there is a question identified by id, null otherwise
-
getByTextLazy
Finds the question in the database where text is contained in the text of the question with Lazy Loading parameters:offset
andlimit
- Parameters:
text
- the text of the question to be foundoffset
- initial position for the querylimit
- limiting query results- Returns:
- an instance of Question if there is a question identified by id, null otherwise
-
getByUser
Finds the question in the database created by a specified user- Parameters:
userId
- id of the user- Returns:
- an instance of Question if there is a question identified by id, null otherwise
-
getByUserLazy
Finds the question in the database created by a specified user with Lazy Loading parameters:- Parameters:
userId
- id of the useroffset
- initial position for the querylimit
- limiting query results- Returns:
- an instance of Question if there is a question identified by id, null otherwise
-
getByCategory
Finds the question identified by id of the category in the database- Parameters:
categoryId
- the id of the category- Returns:
- an instance of Question if there is a question identified by id, null otherwise
-
getByCategoryLazy
Finds the question identified by id of the category in the database with Lazy Loading parameters:- Parameters:
categoryId
- the id of the categoryoffset
- initial position for the querylimit
- limiting query results- Returns:
- an instance of Question if there is a question identified by id, null otherwise
-
remove
Deletes from the database the question identified by id.- Parameters:
id
- the id of the question to be deleted- Throws:
NotFoundException
- if no question identified byid
has been found
-
modify
Updates a question in the database using a new instance of Question.- Parameters:
question
- the new instance of Question
-