Spring Data MongoDB - Spring Web Services - Parent - SpringSource
Spring Data MongoDB - Spring Web Services - Parent - SpringSource Spring Data MongoDB - Spring Web Services - Parent - SpringSource
please define productname in your docbook file!public class PersonWriteConverter implements Converter {public DBObject convert(Person source) {DBObject dbo = new BasicDBObject();dbo.put("_id", source.getId());dbo.put("name", source.getFirstName());dbo.put("age", source.getAge());return dbo;}}1.4.0.BUILD-SNAPSHOTSpring Data MongoDB -Reference Documentation 87
please define productname in your docbook file!8. Cross Store supportSometimes you need to store data in multiple data stores and these data stores can be of differenttypes. One might be relational while the other a document store. For this use case we have created aseparate module in the MongoDB support that handles what we call cross-store support. The currentimplemenatation is based on JPA as the driver for the relational database and we allow select fields inthe Entities to be stored in a Mongo database. In addition to allowing you to store your data in two storeswe also coordinate persistence operations for the non-transactional MongoDB store with the transactionlife-cycle for the relational database.8.1 Cross Store ConfigurationAssuming that you have a working JPA application and would like to add some cross-store persistencefor MongoDB. What do you have to add to your configuration?First of all you need to add a dependency on the spring-data-mongodb-cross-store module.Using Maven this is done by adding a dependency to your pom:4.0.0...org.springframework.dataspring-data-mongodb-cross-store${spring.data.mongo.version}...Example 8.1 Example Maven pom.xml with spring-data-mongodb-cross-store dependencyOnce this is done we need to enable AspectJ for the project. The cross-store support is implementedusing AspectJ aspects so by enabling compile time AspectJ support the cross-store features will becomeavailable to your project. In Maven you would add an additional plugin to the section of the pom:1.4.0.BUILD-SNAPSHOTSpring Data MongoDB -Reference Documentation 88
- Page 42 and 43: please define productname in your d
- Page 44 and 45: please define productname in your d
- Page 46 and 47: please define productname in your d
- Page 48 and 49: please define productname in your d
- Page 50 and 51: please define productname in your d
- Page 52 and 53: please define productname in your d
- Page 54 and 55: please define productname in your d
- Page 56 and 57: please define productname in your d
- Page 58 and 59: please define productname in your d
- Page 60 and 61: please define productname in your d
- Page 62 and 63: please define productname in your d
- Page 64 and 65: please define productname in your d
- Page 66 and 67: please define productname in your d
- Page 68 and 69: please define productname in your d
- Page 70 and 71: please define productname in your d
- Page 72 and 73: please define productname in your d
- Page 74 and 75: please define productname in your d
- Page 76 and 77: please define productname in your d
- Page 78 and 79: please define productname in your d
- Page 80 and 81: please define productname in your d
- Page 82 and 83: please define productname in your d
- Page 84 and 85: please define productname in your d
- Page 86 and 87: please define productname in your d
- Page 88 and 89: please define productname in your d
- Page 90 and 91: please define productname in your d
- Page 94 and 95: please define productname in your d
- Page 96 and 97: please define productname in your d
- Page 98 and 99: please define productname in your d
- Page 100 and 101: please define productname in your d
- Page 102 and 103: please define productname in your d
- Page 104: please define productname in your d
please define productname in your docbook file!8. Cross Store supportSometimes you need to store data in multiple data stores and these data stores can be of differenttypes. One might be relational while the other a document store. For this use case we have created aseparate module in the <strong>MongoDB</strong> support that handles what we call cross-store support. The currentimplemenatation is based on JPA as the driver for the relational database and we allow select fields inthe Entities to be stored in a Mongo database. In addition to allowing you to store your data in two storeswe also coordinate persistence operations for the non-transactional <strong>MongoDB</strong> store with the transactionlife-cycle for the relational database.8.1 Cross Store ConfigurationAssuming that you have a working JPA application and would like to add some cross-store persistencefor <strong>MongoDB</strong>. What do you have to add to your configuration?First of all you need to add a dependency on the spring-data-mongodb-cross-store module.Using Maven this is done by adding a dependency to your pom:4.0.0...org.springframework.dataspring-data-mongodb-cross-store${spring.data.mongo.version}...Example 8.1 Example Maven pom.xml with spring-data-mongodb-cross-store dependencyOnce this is done we need to enable AspectJ for the project. The cross-store support is implementedusing AspectJ aspects so by enabling compile time AspectJ support the cross-store features will becomeavailable to your project. In Maven you would add an additional plugin to the section of the pom:1.4.0.BUILD-SNAPSHOT<strong>Spring</strong> <strong>Data</strong> <strong>MongoDB</strong> -Reference Documentation 88