-
Aug 7th, 2012, 07:44 PM
#1
Progmatically definine <jpa:repository>
Hi,
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"/>
Thanks
-
Aug 8th, 2012, 02:16 PM
#2
Spring Data JPA 1.2 introduces @EnableJpaRepositories annotation that can be used for this purpose:
http://static.springsource.org/sprin...es.java-config
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
#3
whats the alternative? I'm looking for a practice solution.
-
Aug 8th, 2012, 03:47 PM
#4
You might want to take a look of this application context configuration class:
https://bitbucket.org/mikaelhg/proje...iguration.java
This project is using Spring Data JPA 1.1.0.M1.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules