Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 51096ec

Browse files
iluwatar#352- Unit Of Work : Update java doc for methods.
1 parent f3f1f54 commit 51096ec

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

unit-of-work/src/main/java/com/iluwatar/unitofwork/IUnitOfWork.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,24 @@ public interface IUnitOfWork<T> {
3232
String DELETE = "DELETE";
3333
String MODIFY = "MODIFY";
3434

35+
/**
36+
* Any register new operation occurring on UnitOfWork is only going to be performed on commit.
37+
*/
3538
void registerNew(T entity);
3639

40+
/**
41+
* Any register modify operation occurring on UnitOfWork is only going to be performed on commit.
42+
*/
3743
void registerModified(T entity);
3844

45+
/**
46+
* Any register delete operation occurring on UnitOfWork is only going to be performed on commit.
47+
*/
3948
void registerDeleted(T entity);
4049

50+
/***
51+
* All UnitOfWork operations batched together executed in commit only.
52+
*/
4153
void commit();
4254

4355
}

unit-of-work/src/main/java/com/iluwatar/unitofwork/StudentRepository.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ private void register(Student student, String operation) {
7878
context.put(operation, studentsToOperate);
7979
}
8080

81+
/**
82+
* All UnitOfWork operations are batched and executed together on commit only.
83+
*/
8184
@Override
8285
public void commit() {
8386
if (context == null || context.size() == 0) {

0 commit comments

Comments
 (0)