This is quite possible, because these technologies are not so different. To get started right away, try the following:
<context:component-scan base-package="com.example.project" scope-resolver="org.springframework.context.annotation.Jsr330ScopeMetadataResolver"> <context:include-filter type="annotation" expression="javax.ejb.Stateless"/> </context:component-scan>
Snap! Now all your SLSBs are now a prototype of Spring beans. If some SLSBs have a state (duh!), You will have to wrap them in a proxy pool, and much more needs to be done. But Spring already supports most of the EE features. For example, at the beginning, stick to the JPA and Hibernate backend - no changes to the DAO code are required, @EntityManger can be introduced in the same way as Spring beans.
In addition, you can mix Spring, and EJB - EJB can be easily injected into Spring beans, providing good interoperability.
UPDATE Also, why do you want to downgrade from JPA do Hibernate? If your application works fine with JPA, use it also in your Spring application - and when you need Hibernate special features, you can still use them.
source share