Skip to content

Commit 382adae

Browse files
Jay Bryantschauder
Jay Bryant
authored andcommitted
Editing pass.
Edited for grammar, punctuation, and usage. Original pull request #283 Related tickets #61
1 parent ffd2474 commit 382adae

File tree

1 file changed

+21
-19
lines changed

1 file changed

+21
-19
lines changed

src/main/asciidoc/envers.adoc

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
[[envers.what.is.spring.data]]
2-
== What is Spring Data Envers
2+
== What is Spring Data Envers?
33

4-
Spring Data Envers differs from other Spring Data modules in that it is always used in combination with another Spring Data Module: Spring Data JPA.
5-
It makes typical Envers queries available in repositories for Spring Data JPA.
4+
Spring Data Envers makes typical Envers queries available in repositories for Spring Data JPA.
5+
It differs from other Spring Data modules in that it is always used in combination with another Spring Data Module: Spring Data JPA.
66

77
[[envers.what]]
88
== What is Envers?
99

10-
Envers is a https://hibernate.org/orm/envers/[Hibernate module] which adds auditing capabilities to JPA entities.
11-
This documentation assumes you are familiar with Envers just as Spring Data Envers relies on Envers being properly configured.
10+
Envers is a https://hibernate.org/orm/envers/[Hibernate module] that adds auditing capabilities to JPA entities.
11+
This documentation assumes you are familiar with Envers, just as Spring Data Envers relies on Envers being properly configured.
1212

1313
[[envers.configuration]]
1414
== Configuration
1515

16-
As a starting point for using Spring Data Envers you need a project with Spring Data JPA on the classpath and an additional `spring-data-envers` dependency.
16+
As a starting point for using Spring Data Envers, you need a project with Spring Data JPA on the classpath and an additional `spring-data-envers` dependency:
1717

18+
====
1819
[source,xml,subs="+attributes"]
1920
----
2021
<dependencies>
@@ -29,10 +30,11 @@ As a starting point for using Spring Data Envers you need a project with Spring
2930
3031
</dependencies>
3132
----
33+
====
3234

33-
This will also bring `hibernate-envers` into the project as a transient dependency.
35+
This also brings `hibernate-envers` into the project as a transient dependency.
3436

35-
In order to enable Spring Data Envers and Spring Data JPA we need to configure two beans and a special `repositoryFactoryBeanClass`
37+
To enable Spring Data Envers and Spring Data JPA, we need to configure two beans and a special `repositoryFactoryBeanClass`:
3638

3739
====
3840
[source,java]
@@ -71,10 +73,10 @@ public class EnversDemoConfiguration {
7173
}
7274
}
7375
----
74-
<1> This is the only difference to a normal Spring Data JPA configuration. `EnversRevisionRepositoryFactoryBean` ensures implementations of the methods in `RevisionRepository` are available.
76+
<1> This is the only difference from a normal Spring Data JPA configuration. `EnversRevisionRepositoryFactoryBean` ensures implementations of the methods in `RevisionRepository` are available.
7577
====
7678

77-
In order to actually use Spring Data Envers make one or more repositories into {spring-data-commons-javadoc-base}/org/springframework/data/repository/history/RevisionRepository.html[`RevisionRepository`] by adding it as an extended interface.
79+
To actually use Spring Data Envers, make one or more repositories into a {spring-data-commons-javadoc-base}/org/springframework/data/repository/history/RevisionRepository.html[`RevisionRepository`] by adding it as an extended interface:
7880

7981
====
8082
[source,java]
@@ -84,12 +86,13 @@ interface PersonRepository
8486
RevisionRepository<Person, Long, Long> // <1>
8587
{}
8688
----
87-
<1> The first type parameter `Person` denotes the entity type, the second (`Long`) the type of the id property and the last one (`Long`) is the type of the revision number.
88-
For Envers in default configuration this should be `Integer` or `Long`.
89+
<1> The first type parameter (`Person`) denotes the entity type, the second (`Long`) denotes the type of the id property, and the last one (`Long`) is the type of the revision number.
90+
For Envers in default configuration, the revision number parameter should be `Integer` or `Long`.
8991
====
9092

91-
The entity for that repository must be an entity with Envers auditing enabled, i.e. it has an `@Audited` annotation.
93+
The entity for that repository must be an entity with Envers auditing enabled (that is, it must have an `@Audited` annotation):
9294

95+
====
9396
[source,java]
9497
----
9598
@Entity
@@ -102,11 +105,12 @@ class Person {
102105
@Version Long version;
103106
}
104107
----
108+
====
105109

106110
[[envers.usage]]
107111
== Usage
108112

109-
You may now use the methods from `RevisionRepository` to query the revisions of the entity as demonstrated in the following test case.
113+
You can now use the methods from `RevisionRepository` to query the revisions of the entity, as the following test case shows:
110114

111115
====
112116
[source,java]
@@ -183,18 +187,16 @@ class EnversIntegrationTests {
183187
}
184188
}
185189
----
186-
<1> This references the application context configuration presented above.
190+
<1> This references the application context configuration presented earlier (in the <<envers.configuration>> section).
187191
====
188192

189193
[[envers.resources]]
190194
== Further Resources
191195

192-
There is a https://github.com/spring-projects/spring-data-examples[Spring Data Envers example in the Spring Data Examples repository] that you can download and play around with to get a feel for how the library works.
196+
You can download the https://github.com/spring-projects/spring-data-examples[Spring Data Envers example in the Spring Data Examples repository] and play around with to get a feel for how the library works.
193197

194198
You should also check out the {spring-data-commons-javadoc-base}/org/springframework/data/repository/history/RevisionRepository.html[Javadoc for `RevisionRepository`] and related classes.
195199

196-
Questions are best asked at https://stackoverflow.com/questions/tagged/spring-data-envers[Stackoverflow using the `spring-data-envers` tag].
200+
You can ask questions at https://stackoverflow.com/questions/tagged/spring-data-envers[Stackoverflow by using the `spring-data-envers` tag].
197201

198202
The https://github.com/spring-projects/spring-data-envers[source code and issue tracker for Spring Data Envers is hosted at GitHub].
199-
200-

0 commit comments

Comments
 (0)