Skip to content

Commit 8135ff5

Browse files
scordioschauder
authored andcommitted
Add Java config example, fix StackOverflow tag URL.
Original pull request #282
1 parent cd0aff4 commit 8135ff5

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

README.adoc

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,24 @@ You can pull in this functionality to your repositories by simply additionally e
3131
----
3232
interface PersonRepository extends RevisionRepository<Person, Long, Integer>, CrudRepository<Person, Long> {
3333
34-
// Your query methods go here
34+
// Your query methods go here
3535
}
3636
----
3737

38-
To successfully activate the Spring Data Envers repository factory use the Spring Data JPA repositories namespace element's `factory-class` attribute:
38+
To successfully activate the Spring Data Envers repository factory, use the Spring Data JPA's `@EnableJpaRepositories` annotation, specifying the `repositoryFactoryBeanClass` attribute:
39+
40+
[source,java]
41+
----
42+
@Configuration
43+
@EnableJpaRepositories(repositoryFactoryBeanClass = EnversRevisionRepositoryFactoryBean.class)
44+
public class ApplicationConfiguration {
45+
46+
// Your configuration beans
47+
48+
}
49+
----
50+
51+
or use the Spring Data JPA repositories namespace element's `factory-class` attribute, in case of XML configuration:
3952

4053
[source,xml]
4154
----
@@ -81,7 +94,7 @@ Having trouble with Spring Data? We’d love to help!
8194
https://docs.spring.io/spring-data/envers/docs/current/reference/html/[reference documentation], and https://docs.spring.io/spring-data/envers/docs/current/api/[Javadocs].
8295
* Learn the Spring basics – Spring Data builds on Spring Framework, check the https://spring.io[spring.io] web-site for a wealth of reference documentation.
8396
If you are just starting out with Spring, try one of the https://spring.io/guides[guides].
84-
* Ask a question - we monitor https://stackoverflow.com[stackoverflow.com] for questions tagged with https://stackoverflow.com/tags/spring-data[`spring-data-envers`].
97+
* Ask a question - we monitor https://stackoverflow.com[stackoverflow.com] for questions tagged with https://stackoverflow.com/tags/spring-data-envers[`spring-data-envers`].
8598
You can also chat with the community on https://gitter.im/spring-projects/spring-data[Gitter].
8699
* Report bugs with Spring Data envers at https://github.com/spring-projects/spring-data-envers/issues[github.com/spring-projects/spring-data-envers/issues].
87100

0 commit comments

Comments
 (0)