|
1 |
| -image:https://spring.io/badges/spring-data-envers/ga.svg[title=Spring Data Envers,link=https://projects.spring.io/spring-data-envers#quick-start] |
2 |
| -image:https://spring.io/badges/spring-data-envers/snapshot.svg[title=Spring Data Envers,link=https://projects.spring.io/spring-data-envers#quick-start] |
| 1 | += Spring Data Envers |
3 | 2 |
|
4 |
| -= Spring Data Envers image:https://jenkins.spring.io/buildStatus/icon?job=spring-data-envers%2Fmain&subject=Build[link=https://jenkins.spring.io/view/SpringData/job/spring-data-envers/] https://gitter.im/spring-projects/spring-data[image:https://badges.gitter.im/spring-projects/spring-data.svg[Gitter]] |
5 |
| - |
6 |
| -This project is an extension of the https://github.com/SpringSource/spring-data-jpa[Spring Data JPA] project to allow access to entity revisions managed by Hibernate Envers.The sources mostly originate from a contribution of Philipp Hügelmeyer https://github.com/hygl[@hygl]. |
7 |
| - |
8 |
| -The core feature of the module consists of an implementation of the `RevisionRepository` of Spring Data Commons. |
9 |
| - |
10 |
| -== Code of Conduct |
11 |
| - |
12 |
| -This project is governed by the https://github.com/spring-projects/.github/blob/e3cc2ff230d8f1dca06535aa6b5a4a23815861d4/CODE_OF_CONDUCT.md[Spring Code of Conduct]. By participating, you are expected to uphold this code of conduct. Please report unacceptable behavior to [email protected]. |
13 |
| - |
14 |
| -== Getting Started |
15 |
| - |
16 |
| -[source,java] |
17 |
| ----- |
18 |
| -public interface RevisionRepository<T, ID extends Serializable, N extends Number & Comparable<N>> { |
19 |
| -
|
20 |
| - Revision<N, T> findLastChangeRevision(ID id); |
21 |
| -
|
22 |
| - Revisions<N, T> findRevisions(ID id); |
23 |
| -
|
24 |
| - Page<Revision<N, T>> findRevisions(ID id, Pageable pageable); |
25 |
| -} |
26 |
| ----- |
27 |
| - |
28 |
| -You can pull in this functionality to your repositories by simply additionally extending the interface just mentioned: |
29 |
| - |
30 |
| -[source,java] |
31 |
| ----- |
32 |
| -interface PersonRepository extends RevisionRepository<Person, Long, Integer>, CrudRepository<Person, Long> { |
33 |
| -
|
34 |
| - // Your query methods go here |
35 |
| -} |
36 |
| ----- |
37 |
| - |
38 |
| -To activate the Spring Data Envers repositories, use the Spring Data Envers' `EnableEnversRepositories` annotation: |
39 |
| - |
40 |
| -[source,java] |
41 |
| ----- |
42 |
| -@Configuration |
43 |
| -@EnableEnversRepositories |
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: |
52 |
| - |
53 |
| -[source,xml] |
54 |
| ----- |
55 |
| -<jpa:repositories base-package="com.acme.repositories" |
56 |
| - factory-class="….EnversRevisionRepositoryFactoryBean" /> |
57 |
| ----- |
58 |
| - |
59 |
| -=== Maven configuration |
60 |
| - |
61 |
| -Add the Maven dependency: |
62 |
| - |
63 |
| -[source,xml] |
64 |
| ----- |
65 |
| -<dependency> |
66 |
| - <groupId>org.springframework.data</groupId> |
67 |
| - <artifactId>spring-data-envers</artifactId> |
68 |
| - <version>${version}.RELEASE</version> |
69 |
| -</dependency> |
70 |
| ----- |
71 |
| - |
72 |
| -If you'd rather like the latest snapshots of the upcoming major version, use our Maven snapshot repository and declare the appropriate dependency version. |
73 |
| - |
74 |
| -[source,xml] |
75 |
| ----- |
76 |
| -<dependency> |
77 |
| - <groupId>org.springframework.data</groupId> |
78 |
| - <artifactId>spring-data-envers</artifactId> |
79 |
| - <version>${version}.BUILD-SNAPSHOT</version> |
80 |
| -</dependency> |
81 |
| -
|
82 |
| -<repository> |
83 |
| - <id>spring-libs-snapshot</id> |
84 |
| - <name>Spring Snapshot Repository</name> |
85 |
| - <url>https://repo.spring.io/libs-snapshot</url> |
86 |
| -</repository> |
87 |
| ----- |
88 |
| - |
89 |
| -== Getting Help |
90 |
| - |
91 |
| -Having trouble with Spring Data? We’d love to help! |
92 |
| - |
93 |
| -* Check the |
94 |
| -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]. |
95 |
| -* 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. |
96 |
| -If you are just starting out with Spring, try one of the https://spring.io/guides[guides]. |
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`]. |
98 |
| -You can also chat with the community on https://gitter.im/spring-projects/spring-data[Gitter]. |
99 |
| -* Report bugs with Spring Data envers at https://github.com/spring-projects/spring-data-envers/issues[github.com/spring-projects/spring-data-envers/issues]. |
100 |
| - |
101 |
| -== Reporting Issues |
102 |
| - |
103 |
| -Spring Data uses GitHub as issue tracking system to record bugs and feature requests. If you want to raise an issue, please follow the recommendations below: |
104 |
| - |
105 |
| -* Before you log a bug, please search the |
106 |
| -https://github.com/spring-projects/spring-data-envers/issues[issue tracker] to see if someone has already reported the problem. |
107 |
| -* If the issue doesn’t already exist, https://github.com/spring-projects/spring-data-envers/issues/new[create a new issue]. |
108 |
| -* Please provide as much information as possible with the issue report, we like to know the version of Spring Data that you are using and JVM version. |
109 |
| -* If you need to paste code, or include a stack trace use Markdown +++```+++ escapes before and after your text. |
110 |
| -* If possible try to create a test-case or project that replicates the issue. Attach a link to your code or a compressed file containing your code. |
111 |
| - |
112 |
| -== Building from Source |
113 |
| - |
114 |
| -You don’t need to build from source to use Spring Data (binaries in https://repo.spring.io[repo.spring.io]), but if you want to try out the latest and greatest, Spring Data can be easily built with the https://github.com/takari/maven-wrapper[maven wrapper]. |
115 |
| -You also need JDK 1.8. |
116 |
| - |
117 |
| -[source,bash] |
118 |
| ----- |
119 |
| - $ ./mvnw clean install |
120 |
| ----- |
121 |
| - |
122 |
| -If you want to build with the regular `mvn` command, you will need https://maven.apache.org/run-maven/index.html[Maven v3.5.0 or above]. |
123 |
| - |
124 |
| -_Also see link:CONTRIBUTING.adoc[CONTRIBUTING.adoc] if you wish to submit pull requests, and in particular please sign the https://cla.pivotal.io/sign/spring[Contributor’s Agreement] before your first non-trivial change._ |
125 |
| - |
126 |
| -=== Building reference documentation |
127 |
| - |
128 |
| -Building the documentation builds also the project without running tests. |
129 |
| - |
130 |
| -[source,bash] |
131 |
| ----- |
132 |
| - $ ./mvnw clean install -Pdistribute |
133 |
| ----- |
134 |
| - |
135 |
| -The generated documentation is available from `target/site/reference/html/index.html`. |
| 3 | +This project is now part of https://github.com/spring-projects/spring-data-jpa[Spring Data JPA 3.0]. |
136 | 4 |
|
137 | 5 | == License
|
138 | 6 |
|
|
0 commit comments