Announcement Announcement Module
Collapse
No announcement yet.
Progmatically definine <jpa:repository> Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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

  • #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.

    Comment


    • #3
      whats the alternative? I'm looking for a practice solution.

      Comment


      • #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.

        Comment

        Working...
        X