From 118a52a8d65e2c97776aafec3569257ab3266758 Mon Sep 17 00:00:00 2001 From: Oliver Gierke Date: Wed, 17 Apr 2013 11:28:46 +0200 Subject: [PATCH] DATAMONGO-654 - Prepare 1.2.1.RELEASE. Upgraded to Spring Data Build 1.0.3.RELEASE. Upgraded to Spring Data Commons 1.5.1.RELEASE. Updated changelog, notice and readme. Polished readme.md. --- README.md | 133 +++++++++++++++---------------- pom.xml | 11 +-- src/main/resources/changelog.txt | 30 +++++++ src/main/resources/notice.txt | 2 +- src/main/resources/readme.txt | 2 +- 5 files changed, 100 insertions(+), 78 deletions(-) diff --git a/README.md b/README.md index 977db51fd..686119af9 100644 --- a/README.md +++ b/README.md @@ -29,19 +29,13 @@ For those in a hurry: * Download the jar through Maven: - - org.springframework.data - spring-data-mongodb - 1.2.0.BUILD-SNAPSHOT - - - - - spring-maven-snapshot - true - Springframework Maven SNAPSHOT Repository - http://maven.springframework.org/snapshot - +```xml + + org.springframework.data + spring-data-mongodb + 1.2.1.RELEASE + +``` ### MongoTemplate MongoTemplate is the central support class for Mongo database operations. It provides @@ -54,93 +48,98 @@ Future plans are to support optional logging and/or exception throwing based on ### Easy Data Repository generation -To simplify the creation of Data Repositories a generic Repository interface and default implementation is provided. Furthermore, Spring will automatically create a Repository implementation for you that adds implementations of finder methods you specify on an interface. +To simplify the creation of data repositories a generic `Repository` interface and default implementation is provided. Furthermore, Spring will automatically create a Repository implementation for you that adds implementations of finder methods you specify on an interface. The Repository interface is - public interface Repository { +```java +public interface Repository { - T save(T entity); + T save(T entity); - List save(Iterable entities); + List save(Iterable entities); - T findById(ID id); + T findById(ID id); - boolean exists(ID id); + boolean exists(ID id); - List findAll(); + List findAll(); - Long count(); + Long count(); - void delete(T entity); + void delete(T entity); - void delete(Iterable entities); + void delete(Iterable entities); - void deleteAll(); - } + void deleteAll(); +} +``` -The MongoRepository extends Repository and will in future add more Mongo specific methods. +The `MongoRepository` extends `Repository` and will in future add more Mongo specific methods. - public interface MongoRepository extends - Repository { - } +```java +public interface MongoRepository extends Repository { +} +``` -SimpleMongoRepository is the out of the box implementation of the MongoRepository you can use for basid CRUD operations. +`SimpleMongoRepository` is the out of the box implementation of the `MongoRepository` you can use for basid CRUD operations. -To go beyond basic CRUD, extend the MongoRepository interface and supply your own finder methods that follow simple naming conventions such that they can be easily converted into queries. +To go beyond basic CRUD, extend the `MongoRepository` interface and supply your own finder methods that follow simple naming conventions such that they can be easily converted into queries. -For example, given a Person class with first and last name properties, a PersonRepository interface that can query for Person by last name and when the first name matches a regular expression is shown below +For example, given a `Person` class with first and last name properties, a `PersonRepository` interface that can query for `Person` by last name and when the first name matches a regular expression is shown below - public interface PersonRepository extends MongoRepository { +```java +public interface PersonRepository extends MongoRepository { - List findByLastname(String lastname); + List findByLastname(String lastname); - List findByFirstnameLike(String firstname); - } + List findByFirstnameLike(String firstname); +} +``` -You can have Spring automatically generate the implemention as shown below +You can have Spring automatically create a proxy for the interface as shown below: - - - - - - - - - - +```xml + + + + + + + + + + - - - - + +``` -This will register an object in the container named PersonRepository. You can use it as shown below +This will find the repository interface and register a proxy object in the container. You can use it as shown below: - @Service - public class MyService { +``java +@Service +public class MyService { - @Autowired - PersonRepository repository; + @Autowired + private final PersonRepository repository; + public void doWork() { - public void doWork() { + repository.deleteAll(); - repository.deleteAll(); + Person person = new Person(); + person.setFirstname("Oliver"); + person.setLastname("Gierke"); + person = repository.save(person); - Person person = new Person(); - person.setFirstname("Oliver"); - person.setLastname("Gierke"); - person = repository.save(person); + List lastNameResults = repository.findByLastname("Gierke"); - List lastNameResults = repository.findByLastname("Gierke"); + List firstNameResults = repository.findByFirstnameLike("Oli*"); - List firstNameResults = repository.findByFirstnameLike("Oli*"); - - } - } + } +} +``` Contributing to Spring Data diff --git a/pom.xml b/pom.xml index 5b6c6fa90..733dabf08 100644 --- a/pom.xml +++ b/pom.xml @@ -15,7 +15,7 @@ org.springframework.data.build spring-data-parent - 1.0.2.RELEASE + 1.0.3.RELEASE ../spring-data-build/parent/pom.xml @@ -29,7 +29,7 @@ multi spring-data-mongodb - 1.5.1.BUILD-SNAPSHOT + 1.5.1.RELEASE 2.10.1 @@ -88,12 +88,5 @@ ${mongo} - - - - spring-libs-snapshot - http://repo.springsource.org/libs-snapshot - - diff --git a/src/main/resources/changelog.txt b/src/main/resources/changelog.txt index 66f9e16ab..ebb2fe2c3 100644 --- a/src/main/resources/changelog.txt +++ b/src/main/resources/changelog.txt @@ -1,6 +1,36 @@ Spring Data MongoDB Changelog ============================= +Changes in version 1.2.1.GA (2013-04-17) +---------------------------------------- +** Bug + * [DATAMONGO-571] - Spring Data for MongoDb doesn't save null values when @Version is added to domain class + * [DATAMONGO-612] - Fix PDF reference documentation name + * [DATAMONGO-613] - Images missing from reference documentation + * [DATAMONGO-617] - NullPointerException in MongoTemplate.initializeVersionProperty(…) + * [DATAMONGO-620] - MongoTemplate.doSaveVersioned(…) does not consider collection handed into the method + * [DATAMONGO-621] - MongoTemplate.initializeVersionProperty(…) does not use ConversionService + * [DATAMONGO-622] - An unversioned object should be created using insert(…) instead of save. + * [DATAMONGO-629] - Different results when using count and find with the same criteria with 'id' field + * [DATAMONGO-638] - MappingContext should not create PersistentEntity instances for native maps + * [DATAMONGO-640] - MongoLog4jAppender suffers from potential NullPointerException when closing Mongo instance + * [DATAMONGO-641] - MongoLog4jAppender suffers from potential NullPointerException when closing Mongo instance + * [DATAMONGO-642] - MongoChangeSetPersister does not use mapped collection name + * [DATAMONGO-646] - Can't insert DBObjects through MongoTemplate + * [DATAMONGO-648] - ID attributes in namespace shouldn't be XSD IDs + +** Improvement + * [DATAMONGO-594] - cross-store=> Define document name using annotation + * [DATAMONGO-632] - Polish namespace XSD to avoid errors in STS + * [DATAMONGO-635] - Fix some Sonar warnings + * [DATAMONGO-637] - Typo in Query.query(…) + * [DATAMONGO-651] - WriteResult not available from thrown Exception + * [DATAMONGO-656] - Potential NullPointerException when debugging in MongoTemplate + +** Task + * [DATAMONGO-597] - Website is severely out-of-date + * [DATAMONGO-654] - Release 1.2.1 + Changes in version 1.2.0.GA (2013-02-08) ---------------------------------------- ** Bug diff --git a/src/main/resources/notice.txt b/src/main/resources/notice.txt index 83c21f2ed..d5149285e 100644 --- a/src/main/resources/notice.txt +++ b/src/main/resources/notice.txt @@ -1,4 +1,4 @@ -Spring Data Document 1.1.2 +Spring Data Document 1.2.1 Copyright (c) [2010-2013] SpringSource, a division of VMware, Inc. This product is licensed to you under the Apache License, Version 2.0 (the "License"). diff --git a/src/main/resources/readme.txt b/src/main/resources/readme.txt index 06d3e815d..343664017 100644 --- a/src/main/resources/readme.txt +++ b/src/main/resources/readme.txt @@ -1,4 +1,4 @@ -SPRING DATA MongoDB 1.0.0.M5 +SPRING DATA MongoDB 1.2.1.GA ---------------------------- Spring Data MongoDB is released under the terms of the Apache Software License Version 2.0 (see license.txt).