Interface UnitOfWork<T>
- All Known Implementing Classes:
AnswerRepositoryImpl
public interface UnitOfWork<T>
Defines the method that will be used by controllers to implement a Unit of Work
- Version:
- 0.4.1
- Author:
- Davide Costantini
-
Method Summary
Modifier and TypeMethodDescriptionvoid
commit
(int surveyId, int userId) Commits the changes made by the user identified byuserId
on the survey identified bysurveyId
.void
registerDeleted
(T entity) Addsentity
to the elements to be deleted.void
registerModified
(T entity) Addsentity
to the elements to be modified.void
registerNew
(T entity) Addsentity
to the elements to be inserted.
-
Method Details
-
registerNew
Addsentity
to the elements to be inserted.- Parameters:
entity
- a new entity of type T
-
registerModified
Addsentity
to the elements to be modified.- Parameters:
entity
- a new entity of type T that will replace the entity with the same id
-
registerDeleted
Addsentity
to the elements to be deleted.- Parameters:
entity
- the entity of type T to be deleted
-
commit
void commit(int surveyId, int userId) Commits the changes made by the user identified byuserId
on the survey identified bysurveyId
.- Parameters:
surveyId
- the id of the surveyuserId
- the id of the user
-