Skip to content

Commit

Permalink
Update code snippet in documentation.
Browse files Browse the repository at this point in the history
Original Pull Request: #3093
  • Loading branch information
christophstrobl committed Aug 8, 2024
1 parent 22fa3c6 commit 2cc8d04
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ In the example above `RepositoryMethodContext.currentMethod()` is used to retrie
`RepositoryMethodContext` exposes information attached to the repository such as the domain type.
In this case we use the repository domain type to identify the name of the index to be searched.

Now that you've got both, the fragment declaration and implementation you can register it in the `META-INF/spring.factories` file, package things up if needed, and you're good to go.
Now that you've got both, the fragment declaration and implementation you can register it in the `META-INF/spring.factories` file, package things up if needed, and you're almost good to go.

.Registering a fragment implementation through `META-INF/spring.factories`
====
Expand All @@ -325,7 +325,7 @@ import org.springframework.data.repository.core.support.RepositoryFactoryBeanSup
import org.springframework.lang.Nullable;
@Configuration
class MyConfiguration implements BeanPostProcessor {
class MyConfiguration {
@Bean
static BeanPostProcessor exposeMethodMetadata() {
Expand All @@ -338,6 +338,7 @@ class MyConfiguration implements BeanPostProcessor {
if(bean instanceof RepositoryFactoryBeanSupport<?,?,?> factoryBean) {
factoryBean.setExposeMetadata(true);
}
return bean;
}
};
}
Expand Down

0 comments on commit 2cc8d04

Please sign in to comment.