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 TypeMethodDescriptionvoidcommit(int surveyId, int userId) Commits the changes made by the user identified byuserIdon the survey identified bysurveyId.voidregisterDeleted(T entity) Addsentityto the elements to be deleted.voidregisterModified(T entity) Addsentityto the elements to be modified.voidregisterNew(T entity) Addsentityto the elements to be inserted.
-
Method Details
-
registerNew
Addsentityto the elements to be inserted.- Parameters:
entity- a new entity of type T
-
registerModified
Addsentityto the elements to be modified.- Parameters:
entity- a new entity of type T that will replace the entity with the same id
-
registerDeleted
Addsentityto 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 byuserIdon the survey identified bysurveyId.- Parameters:
surveyId- the id of the surveyuserId- the id of the user
-