From a8432e13a16f12c9e1263da0f48dc370607c0745 Mon Sep 17 00:00:00 2001 From: Oliver Gierke Date: Thu, 20 Sep 2012 10:38:46 +0200 Subject: [PATCH] DATAMONGO-543 - Polished quick start section. Updated dependency versions to Spring Data MongoDB and Spring. Removed explicit dependency listing. Removed section on how to migrate between 1.0 milestones. Removed obsolete paragraphs. --- src/docbkx/reference/mongodb.xml | 143 +++---------------------------- 1 file changed, 12 insertions(+), 131 deletions(-) diff --git a/src/docbkx/reference/mongodb.xml b/src/docbkx/reference/mongodb.xml index 7b914d001..ad1f5f123 100644 --- a/src/docbkx/reference/mongodb.xml +++ b/src/docbkx/reference/mongodb.xml @@ -107,15 +107,14 @@ <dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-mongodb</artifactId> - <version>1.0.0.M5</version> + <version>1.1.0.RELEASE</version> </dependency> -</dependencies> - +</dependencies> Also change the version of Spring in the pom.xml to be - <spring.framework.version>3.0.6.RELEASE</spring.framework.version> + <spring.framework.version>3.1.2.RELEASE</spring.framework.version> 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 @@ -125,7 +124,7 @@ <repository> <id>spring-milestone</id> <name>Spring Maven MILESTONE Repository</name> - <url>http://maven.springframework.org/milestone</url> + <url>http://repo.springsource.org/libs-milestone</url> </repository> </repositories> @@ -133,8 +132,9 @@ url="http://shrub.appspot.com/maven.springframework.org/milestone/org/springframework/data/">browseable here. - You may also want to set the logging level to DEBUG to see some - additional information, edit the log4j.properties file to have + You may also want to set the logging level to DEBUG to + see some additional information, edit the log4j.properties file to + have log4j.category.org.springframework.data.document.mongodb=DEBUG log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %40.40c:%4L - %m%n @@ -215,9 +215,10 @@ public class MongoApp { You can instantiate the central helper class of Spring Mongo, - MongoTemplate, using the - standard com.mongodb.Mongo object and the name - of the database to use. + MongoTemplate, + using the standard com.mongodb.Mongo object and + the name of the database to use. @@ -241,119 +242,6 @@ public class MongoApp { stored document, they will be used to instantiate the object - -
- - - Required Jars - - The following jars are required to use Spring Data MongoDB - - - - spring-data-mongodb-1.0.0.RELEASE.jar - - - - spring-data-commons-1.2.0.RELEASE.jar - - - - In addition to the above listed Spring Data jars you need to provide the following dependencies: - - - - aopalliance-1.0.0.jar - - - - commons-logging-1.1.1.jar - - - - mongo-java-driver-2.5.3.jar - - - - spring-aop-3.0.7.RELEASE.jar - - - - spring-asm-3.0.7.RELEASE.jar - - - - spring-beans-3.0.7.RELEASE.jar - - - - spring-context-3.0.7.RELEASE.jar - - - - spring-core-3.0.7.RELEASE.jar - - - - spring-expression-3.0.7.RELEASE.jar - - - - -
- -
- Migrating from M2 to M3 - - There were several API changes introduced in the M3 release. To - upgrade from M2 to M3 you will need to make. For a full listing of API - changes please refer to this JDiff - Report. - - The major changes are with respect to MongoTemplate - - - - Constructors have changed on - MongoTemplate. MongoTemplate(Mongo, - String, String) and MongoTemplate(Mongo, String, - String, MongoConverter) were removed. - MongoTemplate(Mongo, String, UserCredentials), - MongoTemplate(MongoDbFactory), MongoTemplate(MongoDbFactory, - MongoConverter) were added. These changes will also effect - usage of wiring up MongoTemplate in - <bean/> XML defintions. - - - - MongoTemplate no longer takes a default - collection name. The collection name is now either specified when - the method is invoked or inferred from the Java class, either the - class name or via mapping metadata. - - - - Reordered parameters in some - MongoTemplate methods to make signatures more - consistent across the board. - - - - Removed MongoTemplate methods that use - MongoReader and - MongoWriter. As an alternative - register a Spring converter with the MappingMongoConverter. See - here for - details. - - - - Added findById methods to - MongoTemplate. - - -
@@ -544,7 +432,6 @@ public class AppConfig { DB getDb() throws DataAccessException; DB getDb(String dbName) throws DataAccessException; - } The following sections show how you can use the contiainer with @@ -601,7 +488,6 @@ public class MongoConfiguration { public @Bean MongoDbFactory mongoDbFactory() throws Exception { return new SimpleMongoDbFactory(new Mongo(), "database"); } - } To define the username and password create an instance of @@ -621,10 +507,7 @@ public class MongoConfiguration { public @Bean MongoTemplate mongoTemplate() throws Exception { return new MongoTemplate(mongoDbFactory()); } -} - - - +}
@@ -685,8 +568,6 @@ public class MongoConfiguration { <bean id="anotherMongoTemplate" class="org.springframework.data.mongodb.core.MongoTemplate"> <constructor-arg name="mongoDbFactory" ref="mongoDbFactory"/> </bean> - -