|
1 | 1 | <?xml version="1.0" encoding="UTF-8"?>
|
2 | 2 | <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
|
3 |
| - "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"> |
| 3 | +"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"> |
4 | 4 | <chapter id="mongo.cross.store">
|
5 | 5 | <title>Cross Store support</title>
|
6 | 6 |
|
7 |
| - <para>Cross Store support introduction. |
8 |
| - </para> |
| 7 | + <para>Sometimes you need to store data in multiple data stores and these |
| 8 | + data stores can be of different types. One might be relational while the |
| 9 | + other a document store. For this use case we have created a separate module |
| 10 | + in the MongoDB support that handles what we call cross-store support. The |
| 11 | + current implemenatation is based on JPA as the driver for the relational |
| 12 | + database and we allow select fields in the Entities to be stored in a Mongo |
| 13 | + database. In addition to allowing you to store your data in two stores we |
| 14 | + also coordinate persistence operations for the non-transactional MongoDB |
| 15 | + store with the transaction life-cycle for the relational database.</para> |
9 | 16 |
|
10 | 17 | <section id="mongodb:croos-store-configuration">
|
11 | 18 | <title>Cross Store Configuration</title>
|
12 | 19 |
|
13 |
| - <para>Cross Store... |
14 |
| - </para> |
| 20 | + <para>Assuming that you have a working JPA application and would like to |
| 21 | + add some cross-store persistence for MongoDB. What do you have to add to |
| 22 | + your configuration?</para> |
15 | 23 |
|
| 24 | + <para>First of all you need to add a dependency on the |
| 25 | + <filename>spring-data-mongodb-cross-store</filename> module. Using Maven |
| 26 | + this is done by adding a dependency to your pom:</para> |
| 27 | + |
| 28 | + <example> |
| 29 | + <title>Example Maven pom.xml</title> |
| 30 | + |
| 31 | + <programlisting language="xml"><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 32 | + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| 33 | + <modelVersion>4.0.0</modelVersion> |
| 34 | + |
| 35 | +... |
| 36 | + |
| 37 | + <!-- Spring Data --> |
| 38 | + <dependency> |
| 39 | + <groupId>org.springframework.data</groupId> |
| 40 | + <artifactId>spring-data-mongodb-cross-store</artifactId> |
| 41 | + <version>${spring.data.mongo.version}</version> |
| 42 | + </dependency> |
| 43 | + |
| 44 | + |
| 45 | +... |
| 46 | + |
| 47 | +</project> |
| 48 | +</programlisting> |
| 49 | + </example> |
| 50 | + |
| 51 | + <para></para> |
16 | 52 | </section>
|
17 | 53 | </chapter>
|
0 commit comments