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!5. MongoDB supportThe MongoDB support contains a wide range of features which are summarized below.• Spring configuration support using Java based @Configuration classes or an XML namespace for aMongo driver instance and replica sets• MongoTemplate helper class that increases productivity performing common Mongo operations.Includes integrated object mapping between documents and POJOs.• Exception translation into Spring's portable Data Access Exception hierarchy• Feature Rich Object Mapping integrated with Spring's Conversion Service• Annotation based mapping metadata but extensible to support other metadata formats• Persistence and mapping lifecycle events• Java based Query, Criteria, and Update DSLs• Automatic implementatin of Repository interfaces including support for custom finder methods.• QueryDSL integration to support type-safe queries.• Cross-store persistance - support for JPA Entities with fields transparently persisted/retrieved usingMongoDB• Log4j log appender• GeoSpatial integrationFor most tasks you will find yourself using MongoTemplate or the Repository support that both leveragethe rich mapping functionality. MongoTemplate is the place to look for accessing functionality such asincrementing counters or ad-hoc CRUD operations. MongoTemplate also provides callback methods sothat it is easy for you to get a hold of the low level API artifacts such as org.mongo.DB to communicatedirectly with MongoDB. The goal with naming conventions on various API artifacts is to copy those inthe base MongoDB Java driver so you can easily map your existing knowledge onto the Spring APIs.5.1 Getting StartedSpring MongoDB support requires MongoDB 1.4 or higher and Java SE 5 or higher. The latestproduction release (2.0.x as of this writing) is recommended. An easy way to bootstrap setting up aworking environment is to create a Spring based project in STS.First you need to set up a running Mongodb server. Refer to the Mongodb Quick Start guide for anexplanation on how to startup a MongoDB instance. Once installed starting MongoDB is typically amatter of executing the following command: MONGO_HOME/bin/mongodTo create a Spring project in STS go to File -> New -> Spring Template Project -> Simple SpringUtility Project --> press Yes when prompted. Then enter a project and a package name such asorg.spring.mongodb.example.Then add the following to pom.xml dependencies section.1.4.0.BUILD-SNAPSHOTSpring Data MongoDB -Reference Documentation 25
please define productname in your docbook file!org.springframework.dataspring-data-mongodb1.1.0.RELEASEAlso change the version of Spring in the pom.xml to be3.1.2.RELEASEYou will also need to add the location of the Spring Milestone repository for maven to your pom.xmlwhich is at the same level of your elementspring-milestoneSpring Maven MILESTONE Repositoryhttp://repo.springsource.org/libs-milestoneThe repository is also browseable here.You may also want to set the logging level to DEBUG to see some additional information, edit thelog4j.properties file to havelog4j.category.org.springframework.data.document.mongodb=DEBUGlog4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %40.40c:%4L - %m%nCreate a simple Person class to persist1.4.0.BUILD-SNAPSHOTSpring Data MongoDB -Reference Documentation 26
- Page 1 and 2: Spring Data MongoDB - Reference Doc
- Page 3 and 4: please define productname in your d
- Page 5 and 6: please define productname in your d
- Page 7 and 8: please define productname in your d
- Page 9 and 10: please define productname in your d
- Page 11: please define productname in your d
- Page 14 and 15: please define productname in your d
- Page 16 and 17: please define productname in your d
- Page 18 and 19: please define productname in your d
- Page 20 and 21: please define productname in your d
- Page 22 and 23: please define productname in your d
- Page 24 and 25: please define productname in your d
- Page 26 and 27: please define productname in your d
- Page 28 and 29: please define productname in your d
- Page 32 and 33: please define productname in your d
- Page 34 and 35: please define productname in your d
- Page 36 and 37: please define productname in your d
- Page 38 and 39: please define productname in your d
- Page 40 and 41: please define productname in your d
- 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
please define productname in your docbook file!org.springframework.dataspring-data-mongodb1.1.0.RELEASEAlso change the version of <strong>Spring</strong> in the pom.xml to be3.1.2.RELEASEYou will also need to add the location of the <strong>Spring</strong> Milestone repository for maven to your pom.xmlwhich is at the same level of your elementspring-milestone<strong>Spring</strong> Maven MILESTONE Repositoryhttp://repo.springsource.org/libs-milestoneThe repository is also browseable here.You may also want to set the logging level to DEBUG to see some additional information, edit thelog4j.properties file to havelog4j.category.org.springframework.data.document.mongodb=DEBUGlog4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %40.40c:%4L - %m%nCreate a simple Person class to persist1.4.0.BUILD-SNAPSHOT<strong>Spring</strong> <strong>Data</strong> <strong>MongoDB</strong> -Reference Documentation 26