#352- Unit Of Work : Update java doc for methods.

This commit is contained in:
Piyush Chaudhari 2017-11-12 15:50:12 +05:30
parent f3f1f54ccc
commit 51096ec445
2 changed files with 15 additions and 0 deletions

View File

@ -32,12 +32,24 @@ public interface IUnitOfWork<T> {
String DELETE = "DELETE"; String DELETE = "DELETE";
String MODIFY = "MODIFY"; String MODIFY = "MODIFY";
/**
* Any register new operation occurring on UnitOfWork is only going to be performed on commit.
*/
void registerNew(T entity); void registerNew(T entity);
/**
* Any register modify operation occurring on UnitOfWork is only going to be performed on commit.
*/
void registerModified(T entity); void registerModified(T entity);
/**
* Any register delete operation occurring on UnitOfWork is only going to be performed on commit.
*/
void registerDeleted(T entity); void registerDeleted(T entity);
/***
* All UnitOfWork operations batched together executed in commit only.
*/
void commit(); void commit();
} }

View File

@ -78,6 +78,9 @@ public class StudentRepository implements IUnitOfWork<Student> {
context.put(operation, studentsToOperate); context.put(operation, studentsToOperate);
} }
/**
* All UnitOfWork operations are batched and executed together on commit only.
*/
@Override @Override
public void commit() { public void commit() {
if (context == null || context.size() == 0) { if (context == null || context.size() == 0) {