Aug 7th, 2012, 07:44 PM
Progmatically definine <jpa:repository>
How would you define the following xml using Java @Configuration? I'm in the process of converting most of the existing xml into java based @configuration.
<jpa:repositories base-package="some repository package" entity-manager-factory-ref="emf" transaction-manager-ref="transactionManager"/>
Aug 8th, 2012, 02:16 PM
Spring Data JPA 1.2 introduces @EnableJpaRepositories annotation that can be used for this purpose:
However, at the moment that version is not stable yet. You might be able to create the needed beans manually as well but I would just wait until 1.2 is stable or use the M1 version.
Aug 8th, 2012, 03:16 PM
whats the alternative? I'm looking for a practice solution.
Aug 8th, 2012, 03:47 PM
You might want to take a look of this application context configuration class:
This project is using Spring Data JPA 1.1.0.M1.
Tags for this Thread