Skip to content

Commit d509676

Browse files
Added documentation for configuration
1 parent aef12a7 commit d509676

File tree

6 files changed

+50
-12
lines changed

6 files changed

+50
-12
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 1.0.4
2+
3+
* Added possibility to use multiple storages
4+
15
# 1.0.3
26

37
* Added the EclipseStoreDataImporter to import data from JPA repositories.

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,13 @@ instructions** are in the documentation](https://xdev-software.github.io/spring-
5555

5656
## Demo
5757

58-
To see how easy it is to implement EclipseStore in your Spring project, take a look at the three
59-
[demos](./spring-data-eclipse-store-demo):<br/>
60-
A [simple](./spring-data-eclipse-store-demo/src/main/java/software/xdev/spring/data/eclipse/store/demo/simple), a
61-
more [complex demo](./spring-data-eclipse-store-demo/src/main/java/software/xdev/spring/data/eclipse/store/demo/complex)
62-
and
63-
a [demo with coexisting JPA](./spring-data-eclipse-store-jpa/src/main/java/software/xdev/spring/data/eclipse/store/jpa).
58+
To see how easy it is to implement EclipseStore in your Spring project, take a look at
59+
the [demos](./spring-data-eclipse-store-demo):
60+
61+
* [Simple demo](https://github.com/xdev-software/spring-data-eclipse-store/tree/develop/spring-data-eclipse-store-demo/src/main/java/software/xdev/spring/data/eclipse/store/demo/simple)
62+
* [Complex demo](https://github.com/xdev-software/spring-data-eclipse-store/tree/develop/spring-data-eclipse-store-demo/src/main/java/software/xdev/spring/data/eclipse/store/demo/complex)
63+
* [Demo with coexisting JPA](https://github.com/xdev-software/spring-data-eclipse-store/tree/develop/spring-data-eclipse-store-jpa/src/main/java/software/xdev/spring/data/eclipse/store/jpa)
64+
* [Dual storage demo](https://github.com/xdev-software/spring-data-eclipse-store/tree/develop/spring-data-eclipse-store-demo/src/main/java/software/xdev/spring/data/eclipse/store/demo/dual/storage)
6465

6566
> [!NOTE]
6667
> Since the library is using reflection to copy data, the following JVM-Arguments may have to be set:
@@ -71,7 +72,6 @@ a [demo with coexisting JPA](./spring-data-eclipse-store-jpa/src/main/java/softw
7172
> --add-opens=java.base/java.time=ALL-UNNAMED
7273
> ```
7374
74-
7575
## Support
7676
7777
If you need support as soon as possible, and you can't wait for any pull request, feel free to

docs/modules/ROOT/nav.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
* xref:index.adoc[Home]
22
* xref:installation.adoc[Installation]
3+
* xref:configuration.adoc[Configuration]
34
* xref:working-copies.adoc[Working Copies]
45
* xref:migration.adoc[Migration]
56
* xref:known-issues.adoc[Known issues]
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
= Configuration
2+
3+
== EclipseStore Spring-Boot Configuration
4+
5+
The simplest way to configure your storage is by using the key/value pairs in a configuration file as described in the https://docs.eclipsestore.io/manual/misc/integrations/spring-boot.html[EclipseStore documentation].
6+
7+
== Detailed Configuration
8+
9+
If you need more control or want to configure your storage in code, we provide a simple Configuration class which can be used as follows:
10+
11+
[source,java,title="Demo configuration"]
12+
----
13+
import org.eclipse.store.storage.embedded.types.EmbeddedStorage;
14+
import org.eclipse.store.storage.embedded.types.EmbeddedStorageFoundation;
15+
import org.eclipse.store.storage.types.Storage;
16+
...
17+
@Configuration
18+
@EnableEclipseStoreRepositories(clientConfigurationClass = DemoConfiguration.class)
19+
public class DemoConfiguration extends EclipseStoreClientConfiguration
20+
{
21+
@Override
22+
public EmbeddedStorageFoundation<?> createEmbeddedStorageFoundation()
23+
{
24+
return EmbeddedStorage.Foundation(Storage.Configuration(Storage.FileProvider(Path.of("demo-storage"))));
25+
}
26+
}
27+
----
28+
The method ``createEmbeddedStorageFoundation`` could return a much more complicated ``EmbeddedStorageFoundation`` as described here in the https://docs.eclipsestore.io/manual/storage/configuration/index.html[EclipseStore documentation about configuration and foundations].
29+
30+
This also enables you to use multiple EclipseStore-Storages in one project. See the https://github.com/xdev-software/spring-data-eclipse-store/tree/develop/spring-data-eclipse-store-demo/src/main/java/software/xdev/spring/data/eclipse/store/demo/dual/storage[Dual storages demo].

docs/modules/ROOT/pages/installation.adoc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,12 @@ Since the library is using reflection to copy data, the following JVM-Arguments
3838

3939
== Demo
4040

41-
To see how easy it is to implement EclipseStore in your Spring project, take a look at the three https://github.com/xdev-software/spring-data-eclipse-store/tree/develop/spring-data-eclipse-store-demo[demos]:
42-
A https://github.com/xdev-software/spring-data-eclipse-store/tree/develop/spring-data-eclipse-store-demo/src/main/java/software/xdev/spring/data/eclipse/store/demo/simple[simple], a more https://github.com/xdev-software/spring-data-eclipse-store/tree/develop/spring-data-eclipse-store-demo/src/main/java/software/xdev/spring/data/eclipse/store/demo/complex[complex demo] and a https://github.com/xdev-software/spring-data-eclipse-store/tree/develop/spring-data-eclipse-store-jpa/src/main/java/software/xdev/spring/data/eclipse/store/jpa[demo with coexisting JPA].
41+
To see how easy it is to implement EclipseStore in your Spring project, take a look at the https://github.com/xdev-software/spring-data-eclipse-store/tree/develop/spring-data-eclipse-store-demo[demos]:
42+
43+
* https://github.com/xdev-software/spring-data-eclipse-store/tree/develop/spring-data-eclipse-store-demo/src/main/java/software/xdev/spring/data/eclipse/store/demo/simple[Simple demo]
44+
* https://github.com/xdev-software/spring-data-eclipse-store/tree/develop/spring-data-eclipse-store-demo/src/main/java/software/xdev/spring/data/eclipse/store/demo/complex[Complex demo]
45+
* https://github.com/xdev-software/spring-data-eclipse-store/tree/develop/spring-data-eclipse-store-jpa/src/main/java/software/xdev/spring/data/eclipse/store/jpa[Demo with coexisting JPA]
46+
* https://github.com/xdev-software/spring-data-eclipse-store/tree/develop/spring-data-eclipse-store-demo/src/main/java/software/xdev/spring/data/eclipse/store/demo/dual/storage[Dual storage demo]
4347

4448
== Drop in compatible [[drop-in-compatible]]
4549

spring-data-eclipse-store-demo/src/main/java/software/xdev/spring/data/eclipse/store/demo/dual/storage/invoice/PersistenceInvoiceConfiguration.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
package software.xdev.spring.data.eclipse.store.demo.dual.storage.invoice;
22

3-
import static org.eclipse.store.storage.embedded.types.EmbeddedStorage.Foundation;
4-
53
import java.nio.file.Path;
64

5+
import org.eclipse.store.storage.embedded.types.EmbeddedStorage;
76
import org.eclipse.store.storage.embedded.types.EmbeddedStorageFoundation;
87
import org.eclipse.store.storage.types.Storage;
98
import org.springframework.context.annotation.Configuration;
@@ -22,6 +21,6 @@ public class PersistenceInvoiceConfiguration extends EclipseStoreClientConfigura
2221
@Override
2322
public EmbeddedStorageFoundation<?> createEmbeddedStorageFoundation()
2423
{
25-
return Foundation(Storage.Configuration(Storage.FileProvider(Path.of("storage-invoice"))));
24+
return EmbeddedStorage.Foundation(Storage.Configuration(Storage.FileProvider(Path.of("storage-invoice"))));
2625
}
2726
}

0 commit comments

Comments
 (0)