diff --git a/src/docbkx/reference/jpa.xml b/src/docbkx/reference/jpa.xml index 3e9c38c56..f045c971b 100644 --- a/src/docbkx/reference/jpa.xml +++ b/src/docbkx/reference/jpa.xml @@ -9,6 +9,91 @@ implementation. +
+ Introduction + +
+ Spring namespace + + The JPA module of Spring Data contains a custom namespace that + allows defining repository beans. It also contains certain features and + element attributes that are special to JPA. Generally the JPA + repositories can be set up using the repositories element: + + + + Setting up JPA repositories using the namespace + + <?xml version="1.0" encoding="UTF-8"?> +<beans xmlns="http://www.springframework.org/schema/beans" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:jpa="http://www.springframework.org/schema/data/jpa + xsi:schemaLocation="http://www.springframework.org/schema/beans + http://www.springframework.org/schema/beans/spring-beans.xsd + http://www.springframework.org/schema/data/jpa + http://www.springframework.org/schema/data/jpa/spring-jpa.xsd"> + + <jpa:repositories base-package="com.acme.repositories" /> + +</beans> + + + Using this element looks up Spring Data repositories as described + in . Beyond that it + activates persistence exception translation for all beans annotated with + @Repository to let exceptions being + thrown by the JPA presistence providers be converted into Spring's + DataAccessException hierarchy. + + + Custom namespace attributes + + Beyond the default attributes of the repositories + element the JPA namespace offers additional attributes to gain more + detailled control over the setup of the repositories: + + + Custom JPA-specific attributes of the repositories + element + + + + + entity-manager-factory-ref + + Explicitly wire the + EntityManagerFactory to be used + with the repositories being detected by the + repositories element. Usually used if multiple + EntityManagerFactory beans are + used within the application. If not configured we will + automatically lookup the single + EntityManagerFactory configured + in the + ApplicationContext. + + + + transaction-manager-ref + + Explicitly wire tha + PlatformTransactionManager to + be used with the repositories being detected by the + repositories element. Usually only necessary if + multiple transaction managers and/or + EntityManagerFactory beans have + been configured. Default to a single defined + PlatformTransactionManager + inside the current + ApplicationContext. + + + +
+
+
+
+
Query methods