mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Merge branch '3.2.x'
Closes gh-40844
This commit is contained in:
commit
336dcab0f9
@ -746,7 +746,7 @@ include-code::MyProperties[]
|
|||||||
In this setup, the presence of a single parameterized constructor implies that constructor binding should be used.
|
In this setup, the presence of a single parameterized constructor implies that constructor binding should be used.
|
||||||
This means that the binder will find a constructor with the parameters that you wish to have bound.
|
This means that the binder will find a constructor with the parameters that you wish to have bound.
|
||||||
If your class has multiple constructors, the `@ConstructorBinding` annotation can be used to specify which constructor to use for constructor binding.
|
If your class has multiple constructors, the `@ConstructorBinding` annotation can be used to specify which constructor to use for constructor binding.
|
||||||
To opt out of constructor binding for a class with a single parameterized constructor, the constructor must be annotated with `@Autowired`.
|
To opt out of constructor binding for a class with a single parameterized constructor, the constructor must be annotated with `@Autowired` or made `private`.
|
||||||
Constructor binding can be used with records.
|
Constructor binding can be used with records.
|
||||||
Unless your record has multiple constructors, there is no need to use `@ConstructorBinding`.
|
Unless your record has multiple constructors, there is no need to use `@ConstructorBinding`.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user