I have a entity class called Customer
, I am using this entity object in another class to set the data. When I use this object below like
@Autowired
In fact, Spring support @Autowire
only for Spring Beans. A java class becomes Spring Bean only when it is created by Spring, otherwise it is not.
A workaround might be to annotate your class with @Configurable
but you would have to use AspectJ
Please look in the Spring documentations on how to use @Configurable
Also, I wonder why you would autowire an entity class ?