I've created a pojo class A(which is basically neither a service nor repository) and I want to inject it to another pojo class B, and this pojo class B I'll inject to a service class later. Can you tell me what annotation should I mark to class A, so that it will be treated as spring bean and it could be autowired to class B
I know one annotation @Component but I'm not sure if this would be good practice to use this annotation in spring boot.
@Component
is the base annotation and it's perfectly fine to use it.
@Service
is only as specialization without any behavior and @Repository
is used for Data access and @Controller
for web.