Skip to content

Commit

Permalink
#19 minor refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
teosarca committed Mar 1, 2017
1 parent f403a87 commit 87d29ef
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,14 @@ public Document load(final DocumentKey documentKey)
public void onReset(String tableName, int recordId)
{
getDocumentPaths(tableName, recordId)
.forEach(documentPath -> forDocumentReadonlyIfLoaded(documentPath, document -> document.refreshFromRepository()));
.forEach(documentPath -> invalidateDocumentByPath(documentPath));
}
};

/* package */ DocumentCollection()
{
super();

CacheMgt.get().addCacheMgtListener(cacheMgtListener);
}

Expand Down Expand Up @@ -257,6 +257,11 @@ public <R> R forRootDocumentWritable(final DocumentPath documentPathOrNew, final
}
}

private final void invalidateDocumentByPath(final DocumentPath documentPath)
{
forDocumentReadonlyIfLoaded(documentPath, document -> document.refreshFromRepository());
}

/**
* Creates a new root document.
*
Expand Down

1 comment on commit 87d29ef

@teosarca
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

task: #19
note: in commit message i forgot to add the repository prefix

Please sign in to comment.