Browse Source

DATAMONGO-1398, DATAMONGO-1395 - Update Lifecycle Events examples in Reference Documentation.

Replace deprecated methods by the supported API.

Original Pull Request: #349
pull/357/head
Mark Paluch 10 years ago committed by Christoph Strobl
parent
commit
0dc6169282
  1. 4
      src/main/asciidoc/reference/mongodb.adoc

4
src/main/asciidoc/reference/mongodb.adoc

@ -2160,7 +2160,7 @@ To intercept an object before it goes through the conversion process (which turn @@ -2160,7 +2160,7 @@ To intercept an object before it goes through the conversion process (which turn
----
public class BeforeConvertListener extends AbstractMongoEventListener<Person> {
@Override
public void onBeforeConvert(Person p) {
public void onBeforeConvert(BeforeConvertEvent<Person> event) {
... does some auditing manipulation, set timestamps, whatever ...
}
}
@ -2174,7 +2174,7 @@ To intercept an object before it goes into the database, you'd register a subcla @@ -2174,7 +2174,7 @@ To intercept an object before it goes into the database, you'd register a subcla
----
public class BeforeSaveListener extends AbstractMongoEventListener<Person> {
@Override
public void onBeforeSave(Person p, DBObject dbo) {
public void onBeforeSave(BeforeSaveEvent<Person> event) {
… change values, delete them, whatever …
}
}

Loading…
Cancel
Save