Browse Source

DATAMONGO-856 - Documentation updates.

Updated references from springsource.org to spring.io. Updated references to mongodb.org. Update vendor to Pivotal Software, Inc. Update required/recommended versions. Update CustomConversions configuration section. Added missing section id's. Fixed some typos. Added missing JavaDoc.

Original pull request: #128.
pull/130/head
Christoph Strobl 12 years ago committed by Oliver Gierke
parent
commit
eb03ae61f2
  1. 18
      README.md
  2. 2
      pom.xml
  3. 2
      spring-data-mongodb-cross-store/template.mf
  4. 2
      spring-data-mongodb-log4j/template.mf
  5. 20
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoDocumentWriter.java
  6. 98
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoOperations.java
  7. 18
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoSynchronization.java
  8. 14
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/CompoundIndex.java
  9. 20
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/Index.java
  10. 26
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/Indexed.java
  11. 96
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query/Criteria.java
  12. 25
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query/Query.java
  13. 32
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query/Update.java
  14. 2
      spring-data-mongodb/template.mf
  15. 4
      src/docbkx/index.xml
  16. 2
      src/docbkx/introduction/getting-started.xml
  17. 8
      src/docbkx/introduction/introduction.xml
  18. 4
      src/docbkx/introduction/requirements.xml
  19. 4
      src/docbkx/introduction/why-sd-doc.xml
  20. 6
      src/docbkx/reference/cross-store.xml
  21. 48
      src/docbkx/reference/mapping.xml
  22. 46
      src/docbkx/reference/mongo-repositories.xml
  23. 23
      src/docbkx/reference/mongodb.xml
  24. 4
      src/main/resources/readme.txt

18
README.md

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
# Spring Data MongoDB
The primary goal of the [Spring Data](http://www.springsource.org/spring-data) project is to make it easier to build Spring-powered applications that use new data access technologies such as non-relational databases, map-reduce frameworks, and cloud based data services.
The primary goal of the [Spring Data](http://projects.spring.io/spring-data) project is to make it easier to build Spring-powered applications that use new data access technologies such as non-relational databases, map-reduce frameworks, and cloud based data services.
The Spring Data MongoDB project aims to provide a familiar and consistent Spring-based programming model for new datastores while retaining store-specific features and capabilities. The Spring Data MongoDB project provides integration with the MongoDB document database. Key functional areas of Spring Data MongoDB are a POJO centric model for interacting with a MongoDB DBCollection and easily writing a repository style data access layer.
@ -8,12 +8,12 @@ The Spring Data MongoDB project aims to provide a familiar and consistent Spring @@ -8,12 +8,12 @@ The Spring Data MongoDB project aims to provide a familiar and consistent Spring
For a comprehensive treatment of all the Spring Data MongoDB features, please refer to:
* the [User Guide](http://static.springsource.org/spring-data/data-mongodb/docs/current/reference/html/)
* the [JavaDocs](http://static.springsource.org/spring-data/data-mongodb/docs/current/api/) have extensive comments in them as well.
* the home page of [Spring Data MongoDB](http://www.springsource.org/spring-data/mongodb) contains links to articles and other resources.
* for more detailed questions, use the [forum](http://forum.springsource.org/forumdisplay.php?f=80).
* the [User Guide](http://docs.spring.io/spring-data/mongodb/docs/current/reference/html/)
* the [JavaDocs](http://docs.spring.io/spring-data/mongodb/docs/current/api/) have extensive comments in them as well.
* the home page of [Spring Data MongoDB](http://projects.spring.io/spring-data-mongodb) contains links to articles and other resources.
* for more detailed questions, use the [forum](http://forum.spring.io/forum/spring-projects/data/nosql).
If you are new to Spring as well as to Spring Data, look for information about [Spring projects](http://www.springsource.org/projects).
If you are new to Spring as well as to Spring Data, look for information about [Spring projects](http://projects.spring.io/).
## Quick Start
@ -53,7 +53,7 @@ MongoTemplate is the central support class for Mongo database operations. It pro @@ -53,7 +53,7 @@ MongoTemplate is the central support class for Mongo database operations. It pro
* Basic POJO mapping support to and from BSON
* Convenience methods to interact with the store (insert object, update objects) and MongoDB specific ones (geo-spatial operations, upserts, map-reduce etc.)
* Connection affinity callback
* Exception translation into Spring's [technology agnostic DAO exception hierarchy](http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/dao.html#dao-exceptions).
* Exception translation into Spring's [technology agnostic DAO exception hierarchy](http://docs.spring.io/spring/docs/current/spring-framework-reference/html/dao.html#dao-exceptions).
### Spring Data repositories
@ -139,9 +139,9 @@ public class MyService { @@ -139,9 +139,9 @@ public class MyService {
Here are some ways for you to get involved in the community:
* Get involved with the Spring community on the Spring Community Forums. Please help out on the [forum](http://forum.springsource.org/forumdisplay.php?f=80) by responding to questions and joining the debate.
* Get involved with the Spring community on the Spring Community Forums. Please help out on the [forum](http://forum.spring.io/forum/spring-projects/data/nosql) by responding to questions and joining the debate.
* Create [JIRA](https://jira.springframework.org/browse/DATADOC) tickets for bugs and new features and comment and vote on the ones that you are interested in.
* Github is for social coding: if you want to write code, we encourage contributions through pull requests from [forks of this repository](http://help.github.com/forking/). If you want to contribute code this way, please reference a JIRA ticket as well covering the specific issue you are addressing.
* Watch for upcoming articles on Spring by [subscribing](http://www.springsource.org/node/feed) to springframework.org
* Watch for upcoming articles on Spring by [subscribing](http://spring.io/blog) to spring.io.
Before we accept a non-trivial patch or pull request we will need you to sign the [contributor's agreement](https://support.springsource.com/spring_committer_signup). Signing the contributor's agreement does not grant anyone commit rights to the main repository, but it does mean that we can accept your contributions, and you will get an author credit if we do. Active contributors might be asked to join the core team, and given the ability to merge pull requests.

2
pom.xml

@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
<name>Spring Data MongoDB</name>
<description>MongoDB support for Spring Data</description>
<url>http://www.springsource.org/spring-data/mongodb</url>
<url>http://projects.spring.io/spring-data-mongodb</url>
<parent>
<groupId>org.springframework.data.build</groupId>

2
spring-data-mongodb-cross-store/template.mf

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
Bundle-SymbolicName: org.springframework.data.mongodb.crossstore
Bundle-Name: Spring Data MongoDB Cross Store Support
Bundle-Vendor: SpringSource
Bundle-Vendor: Pivotal Software, Inc.
Bundle-ManifestVersion: 2
Import-Package:
sun.reflect;version="0";resolution:=optional

2
spring-data-mongodb-log4j/template.mf

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
Bundle-SymbolicName: org.springframework.data.mongodb.log4j
Bundle-Name: Spring Data Mongo DB Log4J Appender
Bundle-Vendor: SpringSource
Bundle-Vendor: Pivotal Software, Inc.
Bundle-ManifestVersion: 2
Import-Package:
sun.reflect;version="0";resolution:=optional

20
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoDocumentWriter.java

@ -1,20 +0,0 @@ @@ -1,20 +0,0 @@
/*
* Copyright 2010-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.data.mongodb.core;
public interface MongoDocumentWriter {
}

98
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoOperations.java

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
/*
* Copyright 2010-2013 the original author or authors.
*
* Copyright 2011-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@ -468,10 +468,32 @@ public interface MongoOperations { @@ -468,10 +468,32 @@ public interface MongoOperations {
*/
<T> T findOne(Query query, Class<T> entityClass, String collectionName);
/**
* Determine result of given {@link Query} contains at least one element.
*
* @param query the {@link Query} class that specifies the criteria used to find a record.
* @param collectionName name of the collection to check for objects.
* @return
*/
boolean exists(Query query, String collectionName);
/**
* Determine result of given {@link Query} contains at least one element.
*
* @param query the {@link Query} class that specifies the criteria used to find a record.
* @param entityClass the parameterized type.
* @return
*/
boolean exists(Query query, Class<?> entityClass);
/**
* Determine result of given {@link Query} contains at least one element.
*
* @param query the {@link Query} class that specifies the criteria used to find a record.
* @param entityClass the parameterized type.
* @param collectionName name of the collection to check for objects.
* @return
*/
boolean exists(Query query, Class<?> entityClass, String collectionName);
/**
@ -529,12 +551,58 @@ public interface MongoOperations { @@ -529,12 +551,58 @@ public interface MongoOperations {
*/
<T> T findById(Object id, Class<T> entityClass, String collectionName);
/**
* Triggers <a href="http://docs.mongodb.org/manual/reference/method/db.collection.findAndModify/">findAndModify<a/>
* to apply provided {@link Update} on documents matching {@link Criteria} of given {@link Query}.
*
* @param query the {@link Query} class that specifies the {@link Criteria} used to find a record and also an optional
* fields specification.
* @param update the {@link Update} to apply on matching documents.
* @param entityClass the parameterized type.
* @return
*/
<T> T findAndModify(Query query, Update update, Class<T> entityClass);
/**
* Triggers <a href="http://docs.mongodb.org/manual/reference/method/db.collection.findAndModify/">findAndModify<a/>
* to apply provided {@link Update} on documents matching {@link Criteria} of given {@link Query}.
*
* @param query the {@link Query} class that specifies the {@link Criteria} used to find a record and also an optional
* fields specification.
* @param update the {@link Update} to apply on matching documents.
* @param entityClass the parameterized type.
* @param collectionName the collection to query.
* @return
*/
<T> T findAndModify(Query query, Update update, Class<T> entityClass, String collectionName);
/**
* Triggers <a href="http://docs.mongodb.org/manual/reference/method/db.collection.findAndModify/">findAndModify<a/>
* to apply provided {@link Update} on documents matching {@link Criteria} of given {@link Query} taking
* {@link FindAndModifyOptions} into account.
*
* @param query the {@link Query} class that specifies the {@link Criteria} used to find a record and also an optional
* fields specification.
* @param update the {@link Update} to apply on matching documents.
* @param options the {@link FindAndModifyOptions} holding additional information.
* @param entityClass the parameterized type.
* @return
*/
<T> T findAndModify(Query query, Update update, FindAndModifyOptions options, Class<T> entityClass);
/**
* Triggers <a href="http://docs.mongodb.org/manual/reference/method/db.collection.findAndModify/">findAndModify<a/>
* to apply provided {@link Update} on documents matching {@link Criteria} of given {@link Query} taking
* {@link FindAndModifyOptions} into account.
*
* @param query the {@link Query} class that specifies the {@link Criteria} used to find a record and also an optional
* fields specification.
* @param update the {@link Update} to apply on matching documents.
* @param options the {@link FindAndModifyOptions} holding additional information.
* @param entityClass the parameterized type.
* @param collectionName the collection to query.
* @return
*/
<T> T findAndModify(Query query, Update update, FindAndModifyOptions options, Class<T> entityClass,
String collectionName);
@ -598,9 +666,9 @@ public interface MongoOperations { @@ -598,9 +666,9 @@ public interface MongoOperations {
* <p/>
* If you object has an "Id' property, it will be set with the generated Id from MongoDB. If your Id property is a
* String then MongoDB ObjectId will be used to populate that string. Otherwise, the conversion from ObjectId to your
* property type will be handled by Spring's BeanWrapper class that leverages Spring 3.0's new Type Conversion API.
* See <a href="http://static.springsource.org/spring/docs/3.0.x/reference/validation.html#core-convert">Spring 3 Type
* Conversion"</a> for more details.
* property type will be handled by Spring's BeanWrapper class that leverages Type Conversion API. See <a
* href="http://docs.spring.io/spring/docs/current/spring-framework-reference/html/validation.html#core-convert"
* >Spring's Type Conversion"</a> for more details.
* <p/>
* <p/>
* Insert is used to initially store the object into the database. To update an existing object use the save method.
@ -655,9 +723,9 @@ public interface MongoOperations { @@ -655,9 +723,9 @@ public interface MongoOperations {
* <p/>
* If you object has an "Id' property, it will be set with the generated Id from MongoDB. If your Id property is a
* String then MongoDB ObjectId will be used to populate that string. Otherwise, the conversion from ObjectId to your
* property type will be handled by Spring's BeanWrapper class that leverages Spring 3.0's new Type Conversion API.
* See <a href="http://static.springsource.org/spring/docs/3.0.x/reference/validation.html#core-convert">Spring 3 Type
* Conversion"</a> for more details.
* property type will be handled by Spring's BeanWrapper class that leverages Type Conversion API. See <a
* href="http://docs.spring.io/spring/docs/current/spring-framework-reference/html/validation.html#core-convert"
* >Spring's Type Conversion"</a> for more details.
*
* @param objectToSave the object to store in the collection
*/
@ -672,9 +740,9 @@ public interface MongoOperations { @@ -672,9 +740,9 @@ public interface MongoOperations {
* <p/>
* If you object has an "Id' property, it will be set with the generated Id from MongoDB. If your Id property is a
* String then MongoDB ObjectId will be used to populate that string. Otherwise, the conversion from ObjectId to your
* property type will be handled by Spring's BeanWrapper class that leverages Spring 3.0's new Type Cobnversion API.
* See <a href="http://static.springsource.org/spring/docs/3.0.x/reference/validation.html#core-convert">Spring 3 Type
* Conversion"</a> for more details.
* property type will be handled by Spring's BeanWrapper class that leverages Type Cobnversion API. See <a
* http://docs.spring.io/spring/docs/current/spring-framework-reference/html/validation.html#core-convert">Spring's
* Type Conversion"</a> for more details.
*
* @param objectToSave the object to store in the collection
* @param collectionName name of the collection to store the object in
@ -814,6 +882,14 @@ public interface MongoOperations { @@ -814,6 +882,14 @@ public interface MongoOperations {
*/
void remove(Query query, Class<?> entityClass);
/**
* Remove all documents that match the provided query document criteria from the the collection used to store the
* entityClass. The Class parameter is also used to help convert the Id of the object if it is present in the query.
*
* @param query
* @param entityClass
* @param collectionName
*/
void remove(Query query, Class<?> entityClass, String collectionName);
/**

18
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoSynchronization.java

@ -1,8 +1,26 @@ @@ -1,8 +1,26 @@
/*
* Copyright 2012-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.data.mongodb.core;
import org.springframework.transaction.support.ResourceHolder;
import org.springframework.transaction.support.ResourceHolderSynchronization;
/**
* @author Oliver Gierke
*/
class MongoSynchronization extends ResourceHolderSynchronization<ResourceHolder, Object> {
public MongoSynchronization(ResourceHolder resourceHolder, Object resourceKey) {

14
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/CompoundIndex.java

@ -51,10 +51,24 @@ public @interface CompoundIndex { @@ -51,10 +51,24 @@ public @interface CompoundIndex {
@Deprecated
IndexDirection direction() default IndexDirection.ASCENDING;
/**
* @see http://docs.mongodb.org/manual/core/index-unique/
* @return
*/
boolean unique() default false;
/**
* If set to true index will skip over any document that is missing the indexed field.
*
* @see http://docs.mongodb.org/manual/core/index-sparse/
* @return
*/
boolean sparse() default false;
/**
* @see http://docs.mongodb.org/manual/core/index-creation/#index-creation-duplicate-dropping
* @return
*/
boolean dropDups() default false;
/**

20
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/Index.java

@ -41,8 +41,7 @@ public class Index implements IndexDefinition { @@ -41,8 +41,7 @@ public class Index implements IndexDefinition {
private boolean sparse = false;
public Index() {
}
public Index() {}
public Index(String key, Direction direction) {
fieldSpec.put(key, direction);
@ -83,16 +82,33 @@ public class Index implements IndexDefinition { @@ -83,16 +82,33 @@ public class Index implements IndexDefinition {
return this;
}
/**
* Reject all documents that contain a duplicate value for the indexed field.
*
* @see http://docs.mongodb.org/manual/core/index-unique/
* @return
*/
public Index unique() {
this.unique = true;
return this;
}
/**
* Skip over any document that is missing the indexed field.
*
* @see http://docs.mongodb.org/manual/core/index-sparse/
* @return
*/
public Index sparse() {
this.sparse = true;
return this;
}
/**
* @see http://docs.mongodb.org/manual/core/index-creation/#index-creation-duplicate-dropping
* @param duplicates
* @return
*/
public Index unique(Duplicates duplicates) {
if (duplicates == Duplicates.DROP) {
this.dropDuplicates = true;

26
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/Indexed.java

@ -32,16 +32,42 @@ import java.lang.annotation.Target; @@ -32,16 +32,42 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
public @interface Indexed {
/**
* If set to true reject all documents that contain a duplicate value for the indexed field.
*
* @see http://docs.mongodb.org/manual/core/index-unique/
* @return
*/
boolean unique() default false;
IndexDirection direction() default IndexDirection.ASCENDING;
/**
* If set to true index will skip over any document that is missing the indexed field.
*
* @see http://docs.mongodb.org/manual/core/index-sparse/
* @return
*/
boolean sparse() default false;
/**
* @see http://docs.mongodb.org/manual/core/index-creation/#index-creation-duplicate-dropping
* @return
*/
boolean dropDups() default false;
/**
* Index name.
*
* @return
*/
String name() default "";
/**
* Colleciton name for index to be created on.
*
* @return
*/
String collection() default "";
/**

96
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query/Criteria.java

@ -43,6 +43,7 @@ import com.mongodb.DBObject; @@ -43,6 +43,7 @@ import com.mongodb.DBObject;
* @author Thomas Risberg
* @author Oliver Gierke
* @author Thomas Darimont
* @author Christoph Strobl
*/
public class Criteria implements CriteriaDefinition {
@ -117,8 +118,9 @@ public class Criteria implements CriteriaDefinition { @@ -117,8 +118,9 @@ public class Criteria implements CriteriaDefinition {
}
/**
* Creates a criterion using the $ne operator
* Creates a criterion using the {@literal $ne} operator.
*
* @see http://docs.mongodb.org/manual/reference/operator/query/ne/
* @param o
* @return
*/
@ -128,8 +130,9 @@ public class Criteria implements CriteriaDefinition { @@ -128,8 +130,9 @@ public class Criteria implements CriteriaDefinition {
}
/**
* Creates a criterion using the $lt operator
* Creates a criterion using the {@literal $lt} operator.
*
* @see http://docs.mongodb.org/manual/reference/operator/query/lt/
* @param o
* @return
*/
@ -139,8 +142,9 @@ public class Criteria implements CriteriaDefinition { @@ -139,8 +142,9 @@ public class Criteria implements CriteriaDefinition {
}
/**
* Creates a criterion using the $lte operator
* Creates a criterion using the {@literal $lte} operator.
*
* @see http://docs.mongodb.org/manual/reference/operator/query/lte/
* @param o
* @return
*/
@ -150,8 +154,9 @@ public class Criteria implements CriteriaDefinition { @@ -150,8 +154,9 @@ public class Criteria implements CriteriaDefinition {
}
/**
* Creates a criterion using the $gt operator
* Creates a criterion using the {@literal $gt} operator.
*
* @see http://docs.mongodb.org/manual/reference/operator/query/gt/
* @param o
* @return
*/
@ -161,8 +166,9 @@ public class Criteria implements CriteriaDefinition { @@ -161,8 +166,9 @@ public class Criteria implements CriteriaDefinition {
}
/**
* Creates a criterion using the $gte operator
* Creates a criterion using the {@literal $gte} operator.
*
* @see http://docs.mongodb.org/manual/reference/operator/query/gte/
* @param o
* @return
*/
@ -172,8 +178,9 @@ public class Criteria implements CriteriaDefinition { @@ -172,8 +178,9 @@ public class Criteria implements CriteriaDefinition {
}
/**
* Creates a criterion using the $in operator
* Creates a criterion using the {@literal $in} operator.
*
* @see http://docs.mongodb.org/manual/reference/operator/query/in/
* @param o the values to match against
* @return
*/
@ -187,8 +194,9 @@ public class Criteria implements CriteriaDefinition { @@ -187,8 +194,9 @@ public class Criteria implements CriteriaDefinition {
}
/**
* Creates a criterion using the $in operator
* Creates a criterion using the {@literal $in} operator.
*
* @see http://docs.mongodb.org/manual/reference/operator/query/in/
* @param c the collection containing the values to match against
* @return
*/
@ -198,8 +206,9 @@ public class Criteria implements CriteriaDefinition { @@ -198,8 +206,9 @@ public class Criteria implements CriteriaDefinition {
}
/**
* Creates a criterion using the $nin operator
* Creates a criterion using the {@literal $nin} operator.
*
* @see http://docs.mongodb.org/manual/reference/operator/query/nin/
* @param o
* @return
*/
@ -207,14 +216,22 @@ public class Criteria implements CriteriaDefinition { @@ -207,14 +216,22 @@ public class Criteria implements CriteriaDefinition {
return nin(Arrays.asList(o));
}
/**
* Creates a criterion using the {@literal $nin} operator.
*
* @see http://docs.mongodb.org/manual/reference/operator/query/nin/
* @param o
* @return
*/
public Criteria nin(Collection<?> o) {
criteria.put("$nin", o);
return this;
}
/**
* Creates a criterion using the $mod operator
* Creates a criterion using the {@literal $mod} operator.
*
* @see http://docs.mongodb.org/manual/reference/operator/query/mod/
* @param value
* @param remainder
* @return
@ -228,8 +245,9 @@ public class Criteria implements CriteriaDefinition { @@ -228,8 +245,9 @@ public class Criteria implements CriteriaDefinition {
}
/**
* Creates a criterion using the $all operator
* Creates a criterion using the {@literal $all} operator.
*
* @see http://docs.mongodb.org/manual/reference/operator/query/all/
* @param o
* @return
*/
@ -237,14 +255,22 @@ public class Criteria implements CriteriaDefinition { @@ -237,14 +255,22 @@ public class Criteria implements CriteriaDefinition {
return all(Arrays.asList(o));
}
/**
* Creates a criterion using the {@literal $all} operator.
*
* @see http://docs.mongodb.org/manual/reference/operator/query/all/
* @param o
* @return
*/
public Criteria all(Collection<?> o) {
criteria.put("$all", o);
return this;
}
/**
* Creates a criterion using the $size operator
* Creates a criterion using the {@literal $size} operator.
*
* @see http://docs.mongodb.org/manual/reference/operator/query/size/
* @param s
* @return
*/
@ -254,8 +280,9 @@ public class Criteria implements CriteriaDefinition { @@ -254,8 +280,9 @@ public class Criteria implements CriteriaDefinition {
}
/**
* Creates a criterion using the $exists operator
* Creates a criterion using the {@literal $exists} operator.
*
* @see http://docs.mongodb.org/manual/reference/operator/query/exists/
* @param b
* @return
*/
@ -265,8 +292,9 @@ public class Criteria implements CriteriaDefinition { @@ -265,8 +292,9 @@ public class Criteria implements CriteriaDefinition {
}
/**
* Creates a criterion using the $type operator
* Creates a criterion using the {@literal $type} operator.
*
* @see http://docs.mongodb.org/manual/reference/operator/query/type/
* @param t
* @return
*/
@ -276,22 +304,31 @@ public class Criteria implements CriteriaDefinition { @@ -276,22 +304,31 @@ public class Criteria implements CriteriaDefinition {
}
/**
* Creates a criterion using the $not meta operator which affects the clause directly following
* Creates a criterion using the {@literal $not} meta operator which affects the clause directly following
*
* @see http://docs.mongodb.org/manual/reference/operator/query/not/
* @return
*/
public Criteria not() {
return not(null);
}
/**
* Creates a criterion using the {@literal $not} operator.
*
* @see http://docs.mongodb.org/manual/reference/operator/query/not/
* @param value
* @return
*/
private Criteria not(Object value) {
criteria.put("$not", value);
return this;
}
/**
* Creates a criterion using a $regex
* Creates a criterion using a {@literal $regex} operator.
*
* @see http://docs.mongodb.org/manual/reference/operator/query/regex/
* @param re
* @return
*/
@ -300,8 +337,10 @@ public class Criteria implements CriteriaDefinition { @@ -300,8 +337,10 @@ public class Criteria implements CriteriaDefinition {
}
/**
* Creates a criterion using a $regex and $options
* Creates a criterion using a {@literal $regex} and {@literal $options} operator.
*
* @see http://docs.mongodb.org/manual/reference/operator/query/regex/
* @see http://docs.mongodb.org/manual/reference/operator/query/regex/#op._S_options
* @param re
* @param options
* @return
@ -334,8 +373,11 @@ public class Criteria implements CriteriaDefinition { @@ -334,8 +373,11 @@ public class Criteria implements CriteriaDefinition {
}
/**
* Creates a geospatial criterion using a $within $center operation. This is only available for Mongo 1.7 and higher.
* Creates a geospatial criterion using a {@literal $within $centerSphere} operation. This is only available for Mongo
* 1.7 and higher.
*
* @see http://docs.mongodb.org/manual/reference/operator/query/geoWithin/
* @see http://docs.mongodb.org/manual/reference/operator/query/centerSphere/
* @param circle must not be {@literal null}
* @return
*/
@ -345,6 +387,13 @@ public class Criteria implements CriteriaDefinition { @@ -345,6 +387,13 @@ public class Criteria implements CriteriaDefinition {
return this;
}
/**
* Creates a geospatial criterion using a {@literal $within} operation.
*
* @see http://docs.mongodb.org/manual/reference/operator/query/geoWithin/
* @param shape
* @return
*/
public Criteria within(Shape shape) {
Assert.notNull(shape);
@ -353,8 +402,9 @@ public class Criteria implements CriteriaDefinition { @@ -353,8 +402,9 @@ public class Criteria implements CriteriaDefinition {
}
/**
* Creates a geospatial criterion using a $near operation
* Creates a geospatial criterion using a {@literal $near} operation.
*
* @see http://docs.mongodb.org/manual/reference/operator/query/near/
* @param point must not be {@literal null}
* @return
*/
@ -365,8 +415,10 @@ public class Criteria implements CriteriaDefinition { @@ -365,8 +415,10 @@ public class Criteria implements CriteriaDefinition {
}
/**
* Creates a geospatial criterion using a $nearSphere operation. This is only available for Mongo 1.7 and higher.
* Creates a geospatial criterion using a {@literal $nearSphere} operation. This is only available for Mongo 1.7 and
* higher.
*
* @see http://docs.mongodb.org/manual/reference/operator/query/nearSphere/
* @param point must not be {@literal null}
* @return
*/
@ -377,8 +429,9 @@ public class Criteria implements CriteriaDefinition { @@ -377,8 +429,9 @@ public class Criteria implements CriteriaDefinition {
}
/**
* Creates a geospatical criterion using a $maxDistance operation, for use with $near
* Creates a geospatical criterion using a {@literal $maxDistance} operation, for use with $near
*
* @see http://docs.mongodb.org/manual/reference/operator/query/maxDistance/
* @param maxDistance
* @return
*/
@ -388,8 +441,9 @@ public class Criteria implements CriteriaDefinition { @@ -388,8 +441,9 @@ public class Criteria implements CriteriaDefinition {
}
/**
* Creates a criterion using the $elemMatch operator
* Creates a criterion using the {@literal $elemMatch} operator
*
* @see http://docs.mongodb.org/manual/reference/operator/query/elemMatch/
* @param c
* @return
*/

25
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query/Query.java

@ -99,11 +99,23 @@ public class Query { @@ -99,11 +99,23 @@ public class Query {
return this.fieldSpec;
}
/**
* Set number of documents to skip before returning results.
*
* @param skip
* @return
*/
public Query skip(int skip) {
this.skip = skip;
return this;
}
/**
* Limit the number of returned documents to {@code limit}.
*
* @param limit
* @return
*/
public Query limit(int limit) {
this.limit = limit;
return this;
@ -231,14 +243,27 @@ public class Query { @@ -231,14 +243,27 @@ public class Query {
return dbo;
}
/**
* Get the number of documents to skip.
*
* @return
*/
public int getSkip() {
return this.skip;
}
/**
* Get the maximum number of documents to be return.
*
* @return
*/
public int getLimit() {
return this.limit;
}
/**
* @return
*/
public String getHint() {
return hint;
}

32
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query/Update.java

@ -96,8 +96,9 @@ public class Update { @@ -96,8 +96,9 @@ public class Update {
}
/**
* Update using the $set update modifier
* Update using the {@literal $set} update modifier
*
* @see http://docs.mongodb.org/manual/reference/operator/update/set/
* @param key
* @param value
* @return
@ -108,8 +109,9 @@ public class Update { @@ -108,8 +109,9 @@ public class Update {
}
/**
* Update using the $setOnInsert update modifier
* Update using the {@literal $setOnInsert} update modifier
*
* @see http://docs.mongodb.org/manual/reference/operator/update/setOnInsert/
* @param key
* @param value
* @return
@ -120,8 +122,9 @@ public class Update { @@ -120,8 +122,9 @@ public class Update {
}
/**
* Update using the $unset update modifier
* Update using the {@literal $unset} update modifier
*
* @see http://docs.mongodb.org/manual/reference/operator/update/unset/
* @param key
* @return
*/
@ -131,8 +134,9 @@ public class Update { @@ -131,8 +134,9 @@ public class Update {
}
/**
* Update using the $inc update modifier
* Update using the {@literal $inc} update modifier
*
* @see http://docs.mongodb.org/manual/reference/operator/update/inc/
* @param key
* @param inc
* @return
@ -143,8 +147,9 @@ public class Update { @@ -143,8 +147,9 @@ public class Update {
}
/**
* Update using the $push update modifier
* Update using the {@literal $push} update modifier
*
* @see http://docs.mongodb.org/manual/reference/operator/update/push/
* @param key
* @param value
* @return
@ -158,6 +163,8 @@ public class Update { @@ -158,6 +163,8 @@ public class Update {
* Update using {@code $push} modifier. <br/>
* Allows creation of {@code $push} command for single or multiple (using {@code $each}) values.
*
* @see http://docs.mongodb.org/manual/reference/operator/update/push/
* @see http://docs.mongodb.org/manual/reference/operator/update/each/
* @param key
* @return {@link PushOperatorBuilder} for given key
*/
@ -190,8 +197,9 @@ public class Update { @@ -190,8 +197,9 @@ public class Update {
}
/**
* Update using the $addToSet update modifier
* Update using the {@literal $addToSet} update modifier
*
* @see http://docs.mongodb.org/manual/reference/operator/update/addToSet/
* @param key
* @param value
* @return
@ -202,8 +210,9 @@ public class Update { @@ -202,8 +210,9 @@ public class Update {
}
/**
* Update using the $pop update modifier
* Update using the {@literal $pop} update modifier
*
* @see http://docs.mongodb.org/manual/reference/operator/update/pop/
* @param key
* @param pos
* @return
@ -214,8 +223,9 @@ public class Update { @@ -214,8 +223,9 @@ public class Update {
}
/**
* Update using the $pull update modifier
* Update using the {@literal $pull} update modifier
*
* @see http://docs.mongodb.org/manual/reference/operator/update/pull/
* @param key
* @param value
* @return
@ -226,8 +236,9 @@ public class Update { @@ -226,8 +236,9 @@ public class Update {
}
/**
* Update using the $pullAll update modifier
* Update using the {@literal $pullAll} update modifier
*
* @see http://docs.mongodb.org/manual/reference/operator/update/pullAll/
* @param key
* @param values
* @return
@ -243,8 +254,9 @@ public class Update { @@ -243,8 +254,9 @@ public class Update {
}
/**
* Update using the $rename update modifier
* Update using the {@literal $rename} update modifier
*
* @see http://docs.mongodb.org/manual/reference/operator/update/rename/
* @param oldName
* @param newName
* @return

2
spring-data-mongodb/template.mf

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
Bundle-SymbolicName: org.springframework.data.mongodb
Bundle-Name: Spring Data MongoDB Support
Bundle-Vendor: SpringSource
Bundle-Vendor: Pivotal Software, Inc.
Bundle-ManifestVersion: 2
Import-Package:
sun.reflect;version="0";resolution:=optional

4
src/docbkx/index.xml

@ -34,6 +34,10 @@ @@ -34,6 +34,10 @@
<firstname>Thomas</firstname>
<surname>Darimont</surname>
</author>
<author>
<firstname>Christoph</firstname>
<surname>Strobl</surname>
</author>
</authorgroup>
<legalnotice>

2
src/docbkx/introduction/getting-started.xml

@ -30,7 +30,7 @@ @@ -30,7 +30,7 @@
<para>Professional, from-the-source support, with guaranteed response
time, is available from <ulink
url="http://www.springsource.com">SpringSource</ulink>, the company
url="http://gopivotal.com/">Pivotal Sofware, Inc.</ulink>, the company
behind Spring Data and Spring.</para>
</section>
</section>

8
src/docbkx/introduction/introduction.xml

@ -62,21 +62,21 @@ @@ -62,21 +62,21 @@
<itemizedlist>
<listitem>
<para>The <ulink url="http://www.mongodb.org/#">online shell</ulink>
<para>The <ulink url="http://try.mongodb.org/">online shell</ulink>
provides a convenient way to interact with a MongoDB instance in
combination with the online <ulink type=""
url="http://www.mongodb.org/display/DOCS/Tutorial">tutorial.</ulink></para>
url="http://docs.mongodb.org/manual/tutorial/getting-started/">tutorial.</ulink></para>
</listitem>
<listitem>
<para>MongoDB <ulink
url="http://www.mongodb.org/display/DOCS/Java+Language+Center">Java
url="http://docs.mongodb.org/ecosystem/drivers/java/">Java
Language Center</ulink></para>
</listitem>
<listitem>
<para>Several <ulink
url="http://www.mongodb.org/display/DOCS/Books">books</ulink>
url="http://www.mongodb.org/books">books</ulink>
available for purchase</para>
</listitem>

4
src/docbkx/introduction/requirements.xml

@ -4,12 +4,12 @@ @@ -4,12 +4,12 @@
<para>Spring Data Document 1.x binaries requires JDK level 6.0 and above,
and
<ulink url="https://spring.io/docs">Spring Framework</ulink>
3.0.x and above.
3.2.x and above.
</para>
<para>
In terms of document stores,
<ulink url="http://www.mongodb.org/">MongoDB</ulink>
preferably version 1.6.5
preferably version 2.4
or later or
<ulink url="http://couchdb.apache.org/">CouchDB</ulink>
1.0.1 or later are required.

4
src/docbkx/introduction/why-sd-doc.xml

@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
provide an extension to the Spring programming model that supports writing
applications that use Document databases. The Spring framework has always
promoted a POJO programming model with a strong emphasis on portability and
productivity. These values are caried over into Spring Data Document.
productivity. These values are carried over into Spring Data Document.
</para>
<para>Notable features that are used in Spring Data Document from the Spring
@ -28,7 +28,7 @@ @@ -28,7 +28,7 @@
framework that are used are the Conversion Service, JMX Exporters, portable
Data Access Exception hierarchy, Spring Expression Language, and Java based
IoC container configuration. The programming model follows the familiar
Spring 'template' style, so if you are familar with Spring template classes
Spring 'template' style, so if you are familiar with Spring template classes
such as JdbcTemplate, JmsTemplate, RestTemplate, you will feel right at
home. For example, MongoTemplate removes much of the boilerplate code you
would have to write when using the MongoDB driver to save POJOs as well as a

6
src/docbkx/reference/cross-store.xml

@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
data stores can be of different types. One might be relational while the
other a document store. For this use case we have created a separate module
in the MongoDB support that handles what we call cross-store support. The
current implemenatation is based on JPA as the driver for the relational
current implementation is based on JPA as the driver for the relational
database and we allow select fields in the Entities to be stored in a Mongo
database. In addition to allowing you to store your data in two stores we
also coordinate persistence operations for the non-transactional MongoDB
@ -186,14 +186,14 @@ @@ -186,14 +186,14 @@
<para>We are assuming that you have a working JPA application so we will
only cover the additional steps needed to persist part of your Entity in
your Mongo database. First you need to identify the field you want
persited. It should be a domain class and follow the general rules for the
persisted. It should be a domain class and follow the general rules for the
Mongo mapping support covered in previous chapters. The field you want
persisted in MongoDB should be annotated using the
<classname>@RelatedDocument</classname> annotation. That is really all you
need to do!. The cross-store aspects take care of the rest. This includes
marking the field with @Transient so it won't be persisted using JPA,
keeping track of any changes made to the field value and writing them to
the database on succesfull transaction completion, loading the document
the database on successful transaction completion, loading the document
from MongoDB the first time the value is used in your application. Here is
an example of a simple Entity that has a field annotated with
@RelatedEntity.</para>

48
src/docbkx/reference/mapping.xml

@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
<chapter id="mapping-chapter">
<title>Mapping</title>
<para>Rich maping support is provided by the
<para>Rich mapping support is provided by the
<classname>MongoMappingConverter</classname>.
<classname>MongoMappingConverter</classname> has a rich metadata model that
provides a full feature set of functionality to map domain objects to
@ -60,13 +60,13 @@ @@ -60,13 +60,13 @@
<listitem>
<para>You can have a single non-zero argument constructor whose
constructor argument names match top level field names of document,
that constructor will be used. Otherewise the zero arg constructor
will be used. if there is more than one non-zero argument constructor
an exception will be thrown.</para>
that constructor will be used. Otherwise the zero arg constructor will
be used. if there is more than one non-zero argument constructor an
exception will be thrown.</para>
</listitem>
</itemizedlist>
<section>
<section id="mapping.conventions.id-field">
<title>How the '_id' field is handled in the mapping layer</title>
<para>MongoDB requires that you have an '_id' field for all documents.
@ -104,7 +104,7 @@ @@ -104,7 +104,7 @@
the Java class it will be converted to and stored as an ObjectId if
possible. ObjectId as a field type is also valid. If you specify a
value for 'id' in your application, the conversion to an ObjectId is
delected to the MongoDBdriver. If the specified 'id' value cannot be
detected to the MongoDBdriver. If the specified 'id' value cannot be
converted to an ObjectId, then the value will be stored as is in the
document's _id field.</para>
</listitem>
@ -172,12 +172,14 @@ public class GeoSpatialAppConfig extends AbstractMongoConfiguration { @@ -172,12 +172,14 @@ public class GeoSpatialAppConfig extends AbstractMongoConfiguration {
// the following are optional
@Bean
@Override
protected void afterMappingMongoConverterCreation(MappingMongoConverter converter) {
Set&lt;Converter&lt;?, ?&gt;&gt; converterList = new HashSet&lt;Converter&lt;?, ?&gt;&gt;();
public CustomConversions customConversions() throws Exception {
List&lt;Converter&lt;?, ?&gt;&gt; converterList = new ArrayList&lt;Converter&lt;?, ?&gt;&gt;();
converterList.add(new org.springframework.data.mongodb.test.PersonReadConverter());
converterList.add(new org.springframework.data.mongodb.test.PersonWriteConverter());
converter.setCustomConverters(converterList);
return new CustomConversions(converterList);
}
@Bean
@ -454,7 +456,7 @@ public class Person&lt;T extends Address&gt; { @@ -454,7 +456,7 @@ public class Person&lt;T extends Address&gt; {
<section id="mapping-custom-object-construction">
<title>Customized Object Construction</title>
<para>The Mapping Subsystem allows the customization of the object
<para>The mapping subsystem allows the customization of the object
construction by annotating a constructor with the
<literal>@PersistenceConstructor</literal> annotation. The values to be
used for the constructor parameters are resolved in the following
@ -487,9 +489,9 @@ public class Person&lt;T extends Address&gt; { @@ -487,9 +489,9 @@ public class Person&lt;T extends Address&gt; {
<programlisting language="java">class OrderItem {
@Id String id;
int quantity;
double unitPrice;
private @Id String id;
private int quantity;
private double unitPrice;
OrderItem(String id, @Value("#root.qty ?: 0") int quantity, double unitPrice) {
this.id = id;
@ -642,20 +644,17 @@ public class Person { @@ -642,20 +644,17 @@ public class Person {
3 Type Conversion</ulink>.</para>
</note>
<para>The <methodname>setConverters</methodname> method on
<classname>SimpleMongoConverter</classname> and
<classname>MappingMongoConverter</classname> should be used for this
purpose. The method
<methodname>afterMappingMongoConverterCreation</methodname> in
<classname>AbstractMongoConfiguration</classname> can be overriden to
configure a MappingMongoConverter. The examples <link
linkend="???">here</link> at the begining of this chapter show how to
perform the configuration using Java and XML.</para>
<para>The method <methodname>customConversions</methodname> in
<classname>AbstractMongoConfiguration</classname> can be used to
configure Converters. The examples <link
linkend="mapping-configuration">here</link> at the begining of this
chapter show how to perform the configuration using Java and XML.</para>
<para>Below is an example of a Spring Converter implementation that
converts from a DBObject to a Person POJO.</para>
<programlisting language="java">public class PersonReadConverter implements Converter&lt;DBObject, Person&gt; {
<programlisting language="java">@ReadingConverter
public class PersonReadConverter implements Converter&lt;DBObject, Person&gt; {
public Person convert(DBObject source) {
Person p = new Person((ObjectId) source.get("_id"), (String) source.get("name"));
@ -668,7 +667,8 @@ public class Person { @@ -668,7 +667,8 @@ public class Person {
<para>Here is an example that converts from a Person to a
DBObject.</para>
<programlisting language="java">public class PersonWriteConverter implements Converter&lt;Person, DBObject&gt; {
<programlisting language="java">@WritingConverter
public class PersonWriteConverter implements Converter&lt;Person, DBObject&gt; {
public DBObject convert(Person source) {
DBObject dbo = new BasicDBObject();

46
src/docbkx/reference/mongo-repositories.xml

@ -224,6 +224,15 @@ public class PersonRepositoryTests { @@ -224,6 +224,15 @@ public class PersonRepositoryTests {
<entry><code>{"age" : {"$gt" : age}}</code></entry>
</row>
<row>
<entry><literal>GreaterThanEqual</literal></entry>
<entry><methodname>findByAgeGreaterThanEqual(int
age)</methodname></entry>
<entry><code>{"age" : {"$gte" : age}}</code></entry>
</row>
<row>
<entry><literal>LessThan</literal></entry>
@ -233,6 +242,15 @@ public class PersonRepositoryTests { @@ -233,6 +242,15 @@ public class PersonRepositoryTests {
<entry><code>{"age" : {"$lt" : age}}</code></entry>
</row>
<row>
<entry><literal>LessThanEqual</literal></entry>
<entry><methodname>findByAgeLessThanEqual(int
age)</methodname></entry>
<entry><code>{"age" : {"$lte" : age}}</code></entry>
</row>
<row>
<entry><literal>Between</literal></entry>
@ -242,6 +260,24 @@ public class PersonRepositoryTests { @@ -242,6 +260,24 @@ public class PersonRepositoryTests {
<entry><code>{"age" : {"$gt" : from, "$lt" : to}}</code></entry>
</row>
<row>
<entry><literal>In</literal></entry>
<entry><methodname>findByAgeIn(Collection ages)
</methodname></entry>
<entry><code>{"age" : {"$in" : [ages...]}}</code></entry>
</row>
<row>
<entry><literal>NotIn</literal></entry>
<entry><methodname>findByAgeNotIn(Collection ages)
</methodname></entry>
<entry><code>{"age" : {"$nin" : [ages...]}}</code></entry>
</row>
<row>
<entry><literal>IsNotNull</literal>,
@ -358,7 +394,7 @@ public class PersonRepositoryTests { @@ -358,7 +394,7 @@ public class PersonRepositoryTests {
</tgroup>
</table></para>
<section>
<section id="mongodb.repositories.queries.geo-spatial">
<title>Geo-spatial repository queries</title>
<para>As you've just seen there are a few keywords triggering
@ -418,7 +454,7 @@ Distance distance = new Distance(200, Metrics.KILOMETERS); @@ -418,7 +454,7 @@ Distance distance = new Distance(200, Metrics.KILOMETERS);
</simplesect>
</section>
<section>
<section id="mongodb.repositories.queries.json-based">
<title>MongoDB JSON based query methods and field restriction</title>
<para>By adding the annotation
@ -452,7 +488,7 @@ Distance distance = new Distance(200, Metrics.KILOMETERS); @@ -452,7 +488,7 @@ Distance distance = new Distance(200, Metrics.KILOMETERS);
set and its value will therefore be null.</para>
</section>
<section>
<section id="mongodb.repositories.queries.type-safe">
<title>Type-safe Query methods</title>
<para>MongoDB repository support integrates with the <ulink
@ -543,12 +579,12 @@ Page&lt;Person&gt; page = repository.findAll(person.lastname.contains("a"), @@ -543,12 +579,12 @@ Page&lt;Person&gt; page = repository.findAll(person.lastname.contains("a"),
</section>
</section>
<section>
<section id="mongodb.repositories.misc">
<title>Miscellaneous</title>
<para/>
<section>
<section id="mongodb.repositories.misc.cdi-integration">
<title>CDI Integration</title>
<para>Instances of the repository interfaces are usually created by a

23
src/docbkx/reference/mongodb.xml

@ -84,10 +84,10 @@ @@ -84,10 +84,10 @@
or higher. The latest production release (2.0.x as of this writing) is
recommended. An easy way to bootstrap setting up a working environment is
to create a Spring based project in <ulink
url="http://www.springsource.com/developer/sts">STS</ulink>.</para>
url="http://spring.io/tools/sts">STS</ulink>.</para>
<para>First you need to set up a running Mongodb server. Refer to the
<ulink url="http://www.mongodb.org/display/DOCS/Quickstart">Mongodb Quick
<ulink url="http://docs.mongodb.org/manual/core/introduction/">Mongodb Quick
Start guide</ulink> for an explanation on how to startup a MongoDB
instance. Once installed starting MongoDB is typically a matter of
executing the following command:
@ -115,6 +115,7 @@ @@ -115,6 +115,7 @@
<para>Also change the version of Spring in the pom.xml to be</para>
<programlisting lang="" language="xml">&lt;spring.framework.version&gt;3.1.2.RELEASE&lt;/spring.framework.version&gt;</programlisting>
<programlisting lang="" language="xml">&lt;spring.framework.version&gt;3.2.8.RELEASE&lt;/spring.framework.version&gt;</programlisting>
<para>You will also need to add the location of the Spring Milestone
repository for maven to your pom.xml which is at the same level of your
@ -124,7 +125,7 @@ @@ -124,7 +125,7 @@
&lt;repository&gt;
&lt;id&gt;spring-milestone&lt;/id&gt;
&lt;name&gt;Spring Maven MILESTONE Repository&lt;/name&gt;
&lt;url&gt;http://repo.springsource.org/libs-milestone&lt;/url&gt;
&lt;url&gt;http://repo.spring.io/libs-milestone&lt;/url&gt;
&lt;/repository&gt;
&lt;/repositories&gt;</programlisting>
@ -310,7 +311,7 @@ public class AppConfig { @@ -310,7 +311,7 @@ public class AppConfig {
classes annoated with the <literal>@Repository</literal> annotation.
This hierarchy and use of <literal>@Repository</literal> is described in
<ulink
url="http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/dao.html">Spring's
url="http://docs.spring.io/spring/docs/current/spring-framework-reference/html/dao.html">Spring's
DAO support features</ulink>.</para>
<para>An example of a Java based bean metadata that supports exception
@ -1459,7 +1460,7 @@ import static org.springframework.data.mongodb.core.query.Update; @@ -1459,7 +1460,7 @@ import static org.springframework.data.mongodb.core.query.Update;
<programlisting>template.upsert(query(where("ssn").is(1111).and("firstName").is("Joe").and("Fraizer").is("Update")), update("address", addr), Person.class);</programlisting>
</section>
<section>
<section id="mongo-template.find-and-upsert">
<title>Finding and Upserting documents in a collection</title>
<para>The <methodname>findAndModify(…)</methodname> method on
@ -2029,7 +2030,7 @@ GeoResults&lt;Restaurant&gt; = operations.geoNear(query, Restaurant.class);</pro @@ -2029,7 +2030,7 @@ GeoResults&lt;Restaurant&gt; = operations.geoNear(query, Restaurant.class);</pro
methods on MongoOperations to simplify the creation and execution of
Map-Reduce operations. It can convert the results of a Map-Reduce
operation to a POJO also integrates with Spring's <ulink
url="http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/resources.html">Resource
url="http://docs.spring.io/spring/docs/current/spring-framework-reference/html/resources.html">Resource
abstraction</ulink> abstraction. This will let you place your JavaScript
files on the file system, classpath, http server or any other Spring
Resource implementation and then reference the JavaScript resources via an
@ -2143,7 +2144,7 @@ MapReduceResults&lt;ValueObject&gt; results = mongoOperations.mapReduce(query, " @@ -2143,7 +2144,7 @@ MapReduceResults&lt;ValueObject&gt; results = mongoOperations.mapReduce(query, "
providing methods on MongoOperations to simplify the creation and
execution of group operations. It can convert the results of the group
operation to a POJO and also integrates with Spring's <ulink
url="http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/resources.html">Resource
url="http://docs.spring.io/spring/docs/current/spring-framework-reference/html/resources.html">Resource
abstraction</ulink> abstraction. This will let you place your JavaScript
files on the file system, classpath, http server or any other Spring
Resource implementation and then reference the JavaScript resources via an
@ -2885,7 +2886,7 @@ List&lt;DBObject&gt; resultList = result.getMappedResults();</programlisting> @@ -2885,7 +2886,7 @@ List&lt;DBObject&gt; resultList = result.getMappedResults();</programlisting>
<note>
<para>For more information on the Spring type conversion service see the
reference docs <ulink
url="http://static.springsource.org/spring/docs/3.0.x/reference/validation.html#core-convert">here</ulink>.</para>
url="http://docs.spring.io/spring/docs/current/spring-framework-reference/html/validation.html#core-convert">here</ulink>.</para>
</note>
<section id="mongo.custom-converters.writer">
@ -2968,7 +2969,7 @@ public class PersonWriteConverter implements Converter&lt;Person, DBObject&gt; { @@ -2968,7 +2969,7 @@ public class PersonWriteConverter implements Converter&lt;Person, DBObject&gt; {
&lt;/mongo:mapping-converter&gt;</programlisting>
</section>
<section>
<section id="mongo.converter-disambiguation">
<title>Converter disambiguation</title>
<para>Generally we inspect the <interfacename>Converter</interfacename>
@ -3244,11 +3245,11 @@ mongoTemplate.dropCollection("MyNewCollection"); </programlisting> @@ -3244,11 +3245,11 @@ mongoTemplate.dropCollection("MyNewCollection"); </programlisting>
interface.</para>
<para>The motivation behind mapping to Spring's <ulink
url="http://static.springsource.org/spring/docs/3.0.x/reference/dao.html#dao-exceptions">consistent
url="http://docs.spring.io/spring/docs/current/spring-framework-reference/html/dao.html#dao-exceptions">consistent
data access exception hierarchy</ulink> is that you are then able to write
portable and descriptive exception handling code without resorting to
coding against <ulink
url="http://www.mongodb.org/display/DOCS/Error+Codes">MongoDB error
url="http://www.mongodb.org/about/contributors/error-codes/">MongoDB error
codes</ulink>. All of Spring's data access exceptions are inherited from
the root <classname>DataAccessException</classname> class so you can be
sure that you will be able to catch all database related exception within

4
src/main/resources/readme.txt

@ -13,5 +13,5 @@ The reference manual and javadoc are located in the 'docs' directory. @@ -13,5 +13,5 @@ The reference manual and javadoc are located in the 'docs' directory.
ADDITIONAL RESOURCES:
Spring Data Homepage: http://www.springsource.org/spring-data
Spring Data Forum: http://forum.springsource.org/forumdisplay.php?f=80
Spring Data Homepage: http://projects.spring.io/spring-data
Spring Data Forum: http://forum.spring.io/forum/spring-projects/data/nosql

Loading…
Cancel
Save