Yes, this is equivalent.
@Lazy javadoc states:
In addition to its role for component initialization, this annotation can also be placed on injection points marked with org.springframework.beans.factory.annotation.Autowired or javax.inject.Inject : In this context, this creates a lazy permission proxy for all affected dependencies, alternatively prior to using org.springframework.beans.factory.ObjectFactory or javax.inject.Provider .
Main part:
this leads to the creation of a lazy resolution proxy for all affected Dependencies
in terms of dependencies, your DogService bean has two of them anyway: * t26> and MouseService mouseService .
Thus, annotating the constructor or all parameters individually will lead to the same result: two dependencies will be lazy loaded.
Note. I tested them, and in both cases the behavior is the same.
source share