@@ -186,6 +186,15 @@ implementation type, consider declaring the most specific return type on your fa
186
186
method (at least as specific as required by the injection points referring to your bean).
187
187
====
188
188
189
+ [NOTE]
190
+ ====
191
+ As of 4.3, `@Autowired` also considers self references for injection (that is, references
192
+ back to the bean that is currently injected). Note that self injection is a fallback.
193
+ In practice, you should use self references as a last resort only (for example, for
194
+ calling other methods on the same instance through the bean's transactional proxy).
195
+ Consider factoring out the affected methods to a separate delegate bean in such a scenario.
196
+ ====
197
+
189
198
You can also instruct Spring to provide all beans of a particular type from the
190
199
`ApplicationContext` by adding the `@Autowired` annotation to a field or method that
191
200
expects an array of that type, as the following example shows:
@@ -268,6 +277,12 @@ use the same bean class). `@Order` values may influence priorities at injection
268
277
but be aware that they do not influence singleton startup order, which is an
269
278
orthogonal concern determined by dependency relationships and `@DependsOn` declarations.
270
279
280
+ Note that `@Order` annotations on configuration classes just influence the evaluation
281
+ order within the overall set of configuration classes on startup. Such configuration-level
282
+ order values do not affect the contained `@Bean` methods at all. For bean-level ordering,
283
+ each `@Bean` method needs to have its own `@Order` annotation which applies within a
284
+ set of multiple matches for the specific bean type (as returned by the factory method).
285
+
271
286
Note that the standard `jakarta.annotation.Priority` annotation is not available at the
272
287
`@Bean` level, since it cannot be declared on methods. Its semantics can be modeled
273
288
through `@Order` values in combination with `@Primary` on a single bean for each type.
0 commit comments