XML equivalent of @ Configurable Annotation in Spring

Is there any XML equivalent of @Configurable annotations?

For example, for bean:

<bean class="org.obliquid.sherd.domain.SalesDocument" scope ="prototype"> <property name="docType" ref="documentTypeProto"/> </bean> 

How can I say that SalesDocument should be @Configurable?

+4
source share
2 answers

No - the goal of @Configurable to inject properties into objects that are not Spring beans. In your SalesDocument example, there is already a Spring bean, and docType will be entered.

+4
source

It is impossible to simply do this from the box that I know of.

One approach to achieving what you want is to use the Spring AspectJ AOP extensions. It will be a lot of work, but if you know that your DAOs need limited configuration (maybe just an EntityManager ?), It can be done.

See the Spring reference documents for more details.

0
source

All Articles