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!Table of ContentsPreface ...................................................................................................................................... vI. Introduction ............................................................................................................................. 11. Why Spring Data - Document? ....................................................................................... 22. Requirements ................................................................................................................. 33. Additional Help Resources .............................................................................................. 43.1. Support ............................................................................................................... 4Community Forum .............................................................................................. 4Professional Support .......................................................................................... 43.2. Following Development ........................................................................................ 44. Working with Spring Data Repositories ............................................................................ 54.1. Core concepts ..................................................................................................... 54.2. Query methods ................................................................................................... 6Defining repository interfaces .............................................................................. 7Fine-tuning repository definition ................................................................... 7Defining query methods ...................................................................................... 7Query lookup strategies .............................................................................. 8Query creation ........................................................................................... 8Property expressions .................................................................................. 9Special parameter handling ........................................................................ 9Creating repository instances ............................................................................ 10XML configuration .................................................................................... 10JavaConfig ............................................................................................... 11Standalone usage .................................................................................... 114.3. Custom implementations for Spring Data repositories ........................................... 11Adding custom behavior to single repositories .................................................... 12Adding custom behavior to all repositories ......................................................... 134.4. Spring Data extensions ...................................................................................... 15Web support .................................................................................................... 15Basic web support .................................................................................... 15Hypermedia support for Pageables ............................................................ 17Repository populators ....................................................................................... 18Legacy web support ......................................................................................... 19Domain class web binding for Spring MVC ................................................ 19Web pagination ........................................................................................ 21II. Reference Documentation ..................................................................................................... 245. MongoDB support ........................................................................................................ 255.1. Getting Started .................................................................................................. 255.2. Examples Repository ......................................................................................... 285.3. Connecting to MongoDB with Spring .................................................................. 28Registering a Mongo instance using Java based metadata ................................. 28Registering a Mongo instance using XML based metadata .................................. 29The MongoDbFactory interface ......................................................................... 30Registering a MongoDbFactory instance using Java based metadata ................... 31Registering a MongoDbFactory instance using XML based metadata ................... 325.4. Introduction to MongoTemplate .......................................................................... 33. Instantiating MongoTemplate ......................................................................... 34WriteResultChecking Policy ....................................................................... 351.4.0.BUILD-SNAPSHOTSpring Data MongoDB -Reference Documentationii
please define productname in your docbook file!WriteConcern ........................................................................................... 35WriteConcernResolver .............................................................................. 355.5. Saving, Updating, and Removing Documents ...................................................... 36How the '_id' field is handled in the mapping layer .............................................. 38Type mapping .................................................................................................. 39Methods for saving and inserting documents ...................................................... 40Which collection will my documents be saved into? .................................... 41Inserting or saving individual objects ......................................................... 41Inserting several objects in a batch ........................................................... 42Updating documents in a collection ................................................................... 42Methods for executing updates for documents ............................................ 42Methods for the Update class ................................................................... 42Upserting documents in a collection .................................................................. 43Finding and Upserting documents in a collection ................................................ 43Methods for removing documents ...................................................................... 445.6. Querying Documents ......................................................................................... 44Querying documents in a collection ................................................................... 45Methods for the Criteria class ................................................................... 45Methods for the Query class ..................................................................... 46Methods for querying for documents .................................................................. 47GeoSpatial Queries .......................................................................................... 47Geo near queries ..................................................................................... 495.7. Map-Reduce Operations .................................................................................... 49Example Usage ................................................................................................ 505.8. Group Operations .............................................................................................. 51Example Usage ................................................................................................ 525.9. Aggregation Framework Support ........................................................................ 53Basic Concepts ................................................................................................ 54Supported Aggregation Operations .................................................................... 54Projection Expressions ..................................................................................... 55Spring Expresison Support in Projection Expressions ................................. 55Aggregation Framework Examples .................................................................... 565.10. Overriding default mapping with custom converters ............................................ 61Saving using a registered Spring Converter ....................................................... 61Reading using a Spring Converter ..................................................................... 62Registering Spring Converters with the MongoConverter ..................................... 62Converter disambiguation ................................................................................. 635.11. Index and Collection managment ...................................................................... 63Methods for creating an Index ........................................................................... 63Accessing index information .............................................................................. 64Methods for working with a Collection ............................................................... 645.12. Executing Commands ...................................................................................... 64Methods for executing commands ..................................................................... 645.13. Lifecycle Events ............................................................................................... 655.14. Exception Translation ....................................................................................... 665.15. Execution callbacks ......................................................................................... 665.16. GridFS support ................................................................................................ 676. MongoDB repositories .................................................................................................. 706.1. Introduction ....................................................................................................... 706.2. Usage ............................................................................................................... 701.4.0.BUILD-SNAPSHOTSpring Data MongoDB -Reference Documentationiii
- Page 1: Spring Data MongoDB - Reference Doc
- 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 30 and 31: 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
please define productname in your docbook file!WriteConcern ........................................................................................... 35WriteConcernResolver .............................................................................. 355.5. Saving, Updating, and Removing Documents ...................................................... 36How the '_id' field is handled in the mapping layer .............................................. 38Type mapping .................................................................................................. 39Methods for saving and inserting documents ...................................................... 40Which collection will my documents be saved into? .................................... 41Inserting or saving individual objects ......................................................... 41Inserting several objects in a batch ........................................................... 42Updating documents in a collection ................................................................... 42Methods for executing updates for documents ............................................ 42Methods for the Update class ................................................................... 42Upserting documents in a collection .................................................................. 43Finding and Upserting documents in a collection ................................................ 43Methods for removing documents ...................................................................... 445.6. Querying Documents ......................................................................................... 44Querying documents in a collection ................................................................... 45Methods for the Criteria class ................................................................... 45Methods for the Query class ..................................................................... 46Methods for querying for documents .................................................................. 47GeoSpatial Queries .......................................................................................... 47Geo near queries ..................................................................................... 495.7. Map-Reduce Operations .................................................................................... 49Example Usage ................................................................................................ 505.8. Group Operations .............................................................................................. 51Example Usage ................................................................................................ 525.9. Aggregation Framework Support ........................................................................ 53Basic Concepts ................................................................................................ 54Supported Aggregation Operations .................................................................... 54Projection Expressions ..................................................................................... 55<strong>Spring</strong> Expresison Support in Projection Expressions ................................. 55Aggregation Framework Examples .................................................................... 565.10. Overriding default mapping with custom converters ............................................ 61Saving using a registered <strong>Spring</strong> Converter ....................................................... 61Reading using a <strong>Spring</strong> Converter ..................................................................... 62Registering <strong>Spring</strong> Converters with the MongoConverter ..................................... 62Converter disambiguation ................................................................................. 635.11. Index and Collection managment ...................................................................... 63Methods for creating an Index ........................................................................... 63Accessing index information .............................................................................. 64Methods for working with a Collection ............................................................... 645.12. Executing Commands ...................................................................................... 64Methods for executing commands ..................................................................... 645.13. Lifecycle Events ............................................................................................... 655.14. Exception Translation ....................................................................................... 665.15. Execution callbacks ......................................................................................... 665.16. GridFS support ................................................................................................ 676. <strong>MongoDB</strong> repositories .................................................................................................. 706.1. Introduction ....................................................................................................... 706.2. Usage ............................................................................................................... 701.4.0.BUILD-SNAPSHOT<strong>Spring</strong> <strong>Data</strong> <strong>MongoDB</strong> -Reference Documentationiii