Repository: cayenne Updated Branches: refs/heads/STABLE-4.0 0b8774d91 -> f6772c064
Minor update and styling (cherry picked from commit 4a8a842) Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/f6772c06 Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/f6772c06 Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/f6772c06 Branch: refs/heads/STABLE-4.0 Commit: f6772c0643dab3e24622d4332231bb80930cc9ac Parents: 0b8774d Author: Nikita Timofeev <stari...@gmail.com> Authored: Wed Feb 7 16:42:08 2018 +0300 Committer: Nikita Timofeev <stari...@gmail.com> Committed: Wed Feb 7 16:42:55 2018 +0300 ---------------------------------------------------------------------- .../asciidoc/_cayenne-guide/part5/commitLog.adoc | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6772c06/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part5/commitLog.adoc ---------------------------------------------------------------------- diff --git a/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part5/commitLog.adoc b/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part5/commitLog.adoc index 5f43f66..9fc9f19 100644 --- a/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part5/commitLog.adoc +++ b/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part5/commitLog.adoc @@ -45,8 +45,8 @@ compile 'org.apache.cayenne:cayenne-commitlog:{version}' In order to use `commitlog` module you need to perform three steps: -1) Mark all entities which changes you are interested in with `@org.apache.cayenne.commitlog.CommitLog` annotation - +. Mark all entities which changes you are interested in with `@org.apache.cayenne.commitlog.CommitLog` annotation ++ [source, Java] ---- @CommitLog(ignoredProperties = {"somePrivatePropertyToSkip"}) @@ -55,11 +55,11 @@ public class MyEntity extends _MyEntity { } ---- -2) Implement `CommitLogListener` interface. - +. Implement `CommitLogListener` interface. ++ [source, java] ---- - CommitLogListener { +public class MyCommitLogListener implements CommitLogListener { @Override public void onPostCommit(ObjectContext originatingContext, ChangeMap changes) { // ChangeMap will contain all information about changes happened in performed commit @@ -72,8 +72,8 @@ public class MyEntity extends _MyEntity { } ---- -3) Inject your listener into `ServerRuntime` - +. Register your listener implementation. ++ [source, java] ---- ServerRuntime.builder() @@ -81,4 +81,6 @@ ServerRuntime.builder() .addListener(MyCommitLogListener.class) .module()) ---- ++ +NOTE: You can use several listeners, but they all will get same changes.