Skip to content

Commit

Permalink
SC S3: Update docs to explain Developers must add package org.springf…
Browse files Browse the repository at this point in the history
…ramework.versions to their repositories package context
  • Loading branch information
Paul Warren committed Mar 8, 2019
1 parent 2c2edb8 commit 2aef419
Showing 1 changed file with 24 additions and 4 deletions.
28 changes: 24 additions & 4 deletions spring-versions-jpa/src/main/asciidoc/jpaversions.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ dependencies {

== Configuring Spring Versions JPA

Before they can be used the locking and versioning capabilities must be configured. This is done by importing the
Before they can be used, the locking and versioning capabilities must be configured. This is done by importing the
`@Configuration` class `org.springframework.versions.jpa.JpaLockingAndVersioningConfig` into your application and
initializing the database with the pre-defined sql scripts:

Expand Down Expand Up @@ -131,11 +131,31 @@ public class LockingAndVersioningConfig {
====

IMPORTANT: This step is unnecessary if you are using Spring Boot as it will automatically enable Spring Versions JPA
when you place `com.github.paulcwarren:spring-versions-jpa-boot-starter` on your application's classpath and your app
when you place `com.github.paulcwarren:spring-versions-jpa-boot-starter` on your application's classpath and your application
is annotated as a `@SpringBootApplication`.

Make sure you also configure the Spring Content Storage module that you wish to use. For details on that, please consult
the reference documentation.
Configure the Spring Content Storage module by adding the package `org.springframework.versions` to your
@Enable...Repositories package context.

====
[source, java]
----
@SpringBootApplication
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
@Configuration
@EnableJpaRepositories(basePackages={"tests.versioning", "org.springframework.versions"}) // <1>
@EnableFilesystemStores(basePackages = "tests.versioning")
public static class ApplicationConfiguration {
}
}
----
<1> This is required whether you are using Spring Boot, or not.
====

= Locking And Versioning

Expand Down

0 comments on commit 2aef419

Please sign in to comment.