Skip to content

Commit 44f0f31

Browse files
committed
Document placeholder and Ant-style pattern support for @Enable…Repositories.
Closes #3366
1 parent a5da12f commit 44f0f31

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

src/main/antora/modules/ROOT/pages/repositories/create-instances.adoc

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,39 @@ class ApplicationConfiguration {
2727

2828
NOTE: The preceding example uses the JPA-specific annotation, which you would change according to the store module you actually use. The same applies to the definition of the `EntityManagerFactory` bean. See the sections covering the store-specific configuration.
2929

30+
[[repositories.create-instances.java-config.placeholders-and-patterns]]
31+
=== Property Placeholders and Ant-style Patterns
32+
33+
The `basePackages` and `value` attributes in `@Enable{store}Repositories` support `${…}` property placeholders which are resolved against the `Environment` as well as Ant-style package patterns such as `"org.example.+++**+++"`.
34+
35+
The following example specifies the `app.scan.packages` property placeholder for the implicit `value` attribute in `@Enable{store}Repositories`.
36+
37+
[tabs]
38+
======
39+
Java::
40+
+
41+
[source,java,indent=0,subs="verbatim,quotes,attributes,specialchars"]
42+
----
43+
@Configuration
44+
@Enable{store}Repositories("${app.scan.packages}") // <1>
45+
public class ApplicationConfiguration {
46+
// …
47+
}
48+
----
49+
<1> `app.scan.packages` property placeholder to be resolved against the `Environment`
50+
51+
Kotlin::
52+
+
53+
[source,kotlin,indent=0,subs="verbatim,quotes,attributes,specialchars"]
54+
----
55+
@Enable{store}Repositories(["\${app.scan.packages}"]) // <1>
56+
class ApplicationConfiguration {
57+
// …
58+
}
59+
----
60+
<1> `app.scan.packages` property placeholder to be resolved against the `Environment`
61+
======
62+
3063
ifeval::[{include-xml-namespaces} != false]
3164
[[repositories.create-instances.spring]]
3265
[[repositories.create-instances.xml]]

0 commit comments

Comments
 (0)