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 Type
    Method
    Description
    void
    commit(int surveyId, int userId)
    Commits the changes made by the user identified by userId on the survey identified by surveyId.
    void
    Adds entity to the elements to be deleted.
    void
    Adds entity to the elements to be modified.
    void
    registerNew(T entity)
    Adds entity to the elements to be inserted.
  • Method Details

    • registerNew

      void registerNew(T entity)
      Adds entity to the elements to be inserted.
      Parameters:
      entity - a new entity of type T
    • registerModified

      void registerModified(T entity)
      Adds entity to the elements to be modified.
      Parameters:
      entity - a new entity of type T that will replace the entity with the same id
    • registerDeleted

      void registerDeleted(T entity)
      Adds entity 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 by userId on the survey identified by surveyId.
      Parameters:
      surveyId - the id of the survey
      userId - the id of the user