java - Is there a recommend way to get Spring 2.5+ to autowire Hibernate domain objects -


Is there any suggestion for getting Spring 2.5+ to autowire domain objects (hibernate (3.0+)? I realize that one way to do this is by using the aspect ( @Configurable), but I would like to avoid dragging it into Aspecze.

Got something Googling but it's just in the sandbox (and just 2.0.x?).

I can create a 10-line hibernate PreLoadEventListener to autowiring it for me, but I think it will actually be something org.springframework.orm .hibernate3 provided.

recommended to provide dependency injection for situations beyond the control of spring The way, to use the aspect-based solution you mentioned, as far as I know, the specific sections in Hibernation have been left in favor of the general perspective described.

Also keep in mind that you do not need @configable if you use AbstractInterfaceDrivenDependencyInjectionAspect . As you said, you must use Be for an Appendage either for load-time or compile-time knitting. As a benefit, you will get dependency injections along with that approach as deserialization for "corner cases".

For a broader example, see how the pattern suggested by Ram Niwas can be implemented and integrated.


Comments