Skip to content

DATACMNS-1545 - Fix documentation anchors for entity callback API. #398

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>org.springframework.data</groupId>
<artifactId>spring-data-commons</artifactId>
<version>2.2.0.BUILD-SNAPSHOT</version>
<version>2.2.0.DATACMNS-1545-SNAPSHOT</version>

<name>Spring Data Core</name>

Expand Down
18 changes: 9 additions & 9 deletions src/main/asciidoc/entity-callbacks.adoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[entity-callbacks]
[[entity-callbacks]]
= Entity Callbacks

The Spring Data infrastructure provides hooks for modifying an entity before and after certain methods are invoked.
Expand All @@ -17,7 +17,7 @@ The Entity Callback API has been introduced with Spring Data Commons 2.2. It is
Existing store specific `ApplicationEvents` are still published *before* the invoking potentially registered `EntityCallback` instances.
====

[entity-callbacks.implement]
[[entity-callbacks.implement]]
== Implementing Entity Callbacks

An `EntityCallback` is directly associated with its domain type through its generic type argument.
Expand Down Expand Up @@ -78,7 +78,7 @@ class DefaultingEntityCallback implements BeforeSaveCallback<Person>, Ordered <2
@Override
public Object onBeforeSave(Person entity, String collection) { <1>

if(collection == "user) {
if(collection == "user") {
return // ...
}

Expand All @@ -95,7 +95,7 @@ class DefaultingEntityCallback implements BeforeSaveCallback<Person>, Ordered <2
<2> Potentially order the entity callback if multiple ones for the same domain type exist. Ordering follows lowest precedence.
====

[entity-callbacks.register]
[[entity-callbacks.register]]
== Registering Entity Callbacks

`EntityCallback` beans are picked up by the store specific implementations in case they are registered in the `ApplicationContext`.
Expand All @@ -107,7 +107,7 @@ The following example explains a collection of valid entity callback registratio
====
[source,java]
----
@Order(1) <1>
@Order(1) <1>
@Component
class First implements BeforeSaveCallback<Person> {

Expand All @@ -119,7 +119,7 @@ class First implements BeforeSaveCallback<Person> {

@Component
class DefaultingEntityCallback implements BeforeSaveCallback<Person>,
Ordered <2> {
Ordered { <2>

@Override
public Object onBeforeSave(Person entity, String collection) {
Expand All @@ -128,22 +128,22 @@ class DefaultingEntityCallback implements BeforeSaveCallback<Person>,

@Override
public int getOrder() {
return 100; <2>
return 100; <2>
}
}

@Configuration
public class EntityCallbackConfiguration {

@Bean
BeforeSaveCallback<Person> unorderedLambdaReceiverCallback() { <3>
BeforeSaveCallback<Person> unorderedLambdaReceiverCallback() { <3>
return (BeforeSaveCallback<Person>) it -> // ...
}
}

@Component
class UserCallbacks implements BeforeConvertCallback<User>,
BeforeSaveCallback<User> { <4>
BeforeSaveCallback<User> { <4>

@Override
public Person onBeforeConvert(User user) {
Expand Down