Compare commits
9 Commits
1.10.8.REL
...
1.10.9.REL
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c9d471e5d5 | ||
|
|
6641277aaa | ||
|
|
29eba6e427 | ||
|
|
d10e4afefd | ||
|
|
14bb4b586f | ||
|
|
d795836994 | ||
|
|
d216fed8db | ||
|
|
26b7267737 | ||
|
|
69d749d028 |
6
pom.xml
6
pom.xml
@@ -5,7 +5,7 @@
|
||||
|
||||
<groupId>org.springframework.data</groupId>
|
||||
<artifactId>spring-data-mongodb-parent</artifactId>
|
||||
<version>1.10.8.RELEASE</version>
|
||||
<version>1.10.9.RELEASE</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>Spring Data MongoDB</name>
|
||||
@@ -15,7 +15,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.data.build</groupId>
|
||||
<artifactId>spring-data-parent</artifactId>
|
||||
<version>1.9.8.RELEASE</version>
|
||||
<version>1.9.9.RELEASE</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
@@ -28,7 +28,7 @@
|
||||
<properties>
|
||||
<project.type>multi</project.type>
|
||||
<dist.id>spring-data-mongodb</dist.id>
|
||||
<springdata.commons>1.13.8.RELEASE</springdata.commons>
|
||||
<springdata.commons>1.13.9.RELEASE</springdata.commons>
|
||||
<mongo>2.14.3</mongo>
|
||||
<mongo.osgi>2.13.0</mongo.osgi>
|
||||
<jmh.version>1.19</jmh.version>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.data</groupId>
|
||||
<artifactId>spring-data-mongodb-parent</artifactId>
|
||||
<version>1.10.8.RELEASE</version>
|
||||
<version>1.10.9.RELEASE</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.data</groupId>
|
||||
<artifactId>spring-data-mongodb-parent</artifactId>
|
||||
<version>1.10.8.RELEASE</version>
|
||||
<version>1.10.9.RELEASE</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework.data</groupId>
|
||||
<artifactId>spring-data-mongodb</artifactId>
|
||||
<version>1.10.8.RELEASE</version>
|
||||
<version>1.10.9.RELEASE</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.data</groupId>
|
||||
<artifactId>spring-data-mongodb-parent</artifactId>
|
||||
<version>1.10.8.RELEASE</version>
|
||||
<version>1.10.9.RELEASE</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.data</groupId>
|
||||
<artifactId>spring-data-mongodb-parent</artifactId>
|
||||
<version>1.10.8.RELEASE</version>
|
||||
<version>1.10.9.RELEASE</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.data</groupId>
|
||||
<artifactId>spring-data-mongodb-parent</artifactId>
|
||||
<version>1.10.8.RELEASE</version>
|
||||
<version>1.10.9.RELEASE</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -863,7 +863,7 @@ public class QueryMapper {
|
||||
|
||||
try {
|
||||
|
||||
PropertyPath path = PropertyPath.from(pathExpression.replaceAll("\\.\\d", ""), entity.getTypeInformation());
|
||||
PropertyPath path = PropertyPath.from(pathExpression.replaceAll("\\.\\d+", ""), entity.getTypeInformation());
|
||||
PersistentPropertyPath<MongoPersistentProperty> propertyPath = mappingContext.getPersistentPropertyPath(path);
|
||||
|
||||
Iterator<MongoPersistentProperty> iterator = propertyPath.iterator();
|
||||
|
||||
@@ -146,6 +146,8 @@ public class BasicMongoPersistentEntity<T> extends BasicPersistentEntity<T, Mong
|
||||
@Override
|
||||
public void verify() {
|
||||
|
||||
super.verify();
|
||||
|
||||
verifyFieldUniqueness();
|
||||
verifyFieldTypes();
|
||||
}
|
||||
|
||||
@@ -21,6 +21,9 @@ import static org.mockito.Mockito.*;
|
||||
import static org.springframework.data.mongodb.core.DBObjectTestUtils.*;
|
||||
import static org.springframework.data.mongodb.test.util.IsBsonObject.*;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
@@ -685,6 +688,23 @@ public class UpdateMapperUnitTests {
|
||||
.containing("$set.concreteTypeWithListAttributeOfInterfaceType.models.[0]._class", ModelImpl.class.getName()));
|
||||
}
|
||||
|
||||
@Test // DATAMONGO-1809
|
||||
public void pathShouldIdentifyPositionalParameterWithMoreThanOneDigit() {
|
||||
|
||||
BasicDBObject at2digitPosition = (BasicDBObject) mapper.getMappedObject(new Update()
|
||||
.addToSet("concreteInnerList.10.concreteTypeList", new SomeInterfaceImpl("szeth")).getUpdateObject(),
|
||||
context.getPersistentEntity(Outer.class));
|
||||
|
||||
BasicDBObject at3digitPosition = (BasicDBObject) mapper.getMappedObject(new Update()
|
||||
.addToSet("concreteInnerList.123.concreteTypeList", new SomeInterfaceImpl("lopen")).getUpdateObject(),
|
||||
context.getPersistentEntity(Outer.class));
|
||||
|
||||
assertThat(at2digitPosition, is(equalTo(new BasicDBObject("$addToSet",
|
||||
new BasicDBObject("concreteInnerList.10.concreteTypeList", new BasicDBObject("value", "szeth"))))));
|
||||
assertThat(at3digitPosition, is(equalTo(new BasicDBObject("$addToSet",
|
||||
new BasicDBObject("concreteInnerList.123.concreteTypeList", new BasicDBObject("value", "lopen"))))));
|
||||
}
|
||||
|
||||
@Test // DATAMONGO-1236
|
||||
public void mappingShouldRetainTypeInformationForObjectValues() {
|
||||
|
||||
@@ -1223,6 +1243,7 @@ public class UpdateMapperUnitTests {
|
||||
static class ConcreteInner {
|
||||
List<SomeInterfaceType> interfaceTypeList;
|
||||
List<SomeAbstractType> abstractTypeList;
|
||||
List<SomeInterfaceImpl> concreteTypeList;
|
||||
}
|
||||
|
||||
interface SomeInterfaceType {
|
||||
@@ -1233,8 +1254,11 @@ public class UpdateMapperUnitTests {
|
||||
|
||||
}
|
||||
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
static class SomeInterfaceImpl extends SomeAbstractType implements SomeInterfaceType {
|
||||
|
||||
String value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
package org.springframework.data.mongodb.core.mapping;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.*;
|
||||
import static org.hamcrest.Matchers.*;
|
||||
import static org.junit.Assert.*;
|
||||
import static org.mockito.Mockito.*;
|
||||
|
||||
@@ -23,6 +23,8 @@ import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
@@ -30,6 +32,8 @@ import org.mockito.Mock;
|
||||
import org.mockito.runners.MockitoJUnitRunner;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.core.annotation.AliasFor;
|
||||
import org.springframework.data.mapping.PersistentProperty;
|
||||
import org.springframework.data.mapping.SimplePropertyHandler;
|
||||
import org.springframework.data.mapping.model.MappingException;
|
||||
import org.springframework.data.util.ClassTypeInformation;
|
||||
|
||||
@@ -223,6 +227,25 @@ public class BasicMongoPersistentEntityUnitTests {
|
||||
assertThat(entity.getCollection(), is("custom-collection"));
|
||||
}
|
||||
|
||||
@Test // DATAMONGO-1737
|
||||
public void honorsFieldOrderWhenIteratingOverProperties() {
|
||||
|
||||
MongoMappingContext context = new MongoMappingContext();
|
||||
BasicMongoPersistentEntity<?> entity = context.getPersistentEntity(Sample.class);
|
||||
|
||||
final List<String> properties = new ArrayList<String>();
|
||||
|
||||
entity.doWithProperties(new SimplePropertyHandler() {
|
||||
|
||||
@Override
|
||||
public void doWithPersistentProperty(PersistentProperty<?> property) {
|
||||
properties.add(property.getName());
|
||||
}
|
||||
});
|
||||
|
||||
assertThat(properties, contains("first", "second", "third"));
|
||||
}
|
||||
|
||||
@Document(collection = "contacts")
|
||||
class Contact {}
|
||||
|
||||
@@ -253,6 +276,13 @@ public class BasicMongoPersistentEntityUnitTests {
|
||||
@ComposedDocumentAnnotation
|
||||
static class DocumentWithComposedAnnotation {}
|
||||
|
||||
class Sample {
|
||||
|
||||
@org.springframework.data.mongodb.core.mapping.Field(order = 2) String second;
|
||||
@org.springframework.data.mongodb.core.mapping.Field(order = 3) String third;
|
||||
@org.springframework.data.mongodb.core.mapping.Field(order = 1) String first;
|
||||
}
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ ElementType.TYPE })
|
||||
@Document(collection = "collection-1")
|
||||
|
||||
@@ -29,5 +29,5 @@ class Config {
|
||||
----
|
||||
====
|
||||
|
||||
If you expose a bean of type `AuditorAware` to the `ApplicationContext`, the auditing infrastructure will pick it up automatically and use it to determine the current user to be set on domain types. If you have multiple implementations registered in the `ApplicationContext`, you can select the one to be used by explicitly setting the `auditorAwareRef` attribute of `@EnableJpaAuditing`.
|
||||
If you expose a bean of type `AuditorAware` to the `ApplicationContext`, the auditing infrastructure will pick it up automatically and use it to determine the current user to be set on domain types. If you have multiple implementations registered in the `ApplicationContext`, you can select the one to be used by explicitly setting the `auditorAwareRef` attribute of `@EnableMongoAuditing`.
|
||||
|
||||
|
||||
@@ -1,6 +1,27 @@
|
||||
Spring Data MongoDB Changelog
|
||||
=============================
|
||||
|
||||
Changes in version 1.10.9.RELEASE (2017-11-27)
|
||||
----------------------------------------------
|
||||
* DATAMONGO-1809 - Type hint usage broken when using positional parameters with more than one digit.
|
||||
* DATAMONGO-1799 - Release 1.10.9 (Ingalls SR9).
|
||||
* DATAMONGO-1696 - Reference documentation uses JPA Annotations.
|
||||
|
||||
|
||||
Changes in version 2.0.1.RELEASE (2017-10-27)
|
||||
---------------------------------------------
|
||||
* DATAMONGO-1815 - Adapt API changes in Property in test cases.
|
||||
* DATAMONGO-1814 - Missing documentation on Faceted classification.
|
||||
* DATAMONGO-1811 - Reference Documentation doesn't match with API Documentation 2.X vesrion.
|
||||
* DATAMONGO-1809 - Type hint usage broken when using positional parameters with more than one digit.
|
||||
* DATAMONGO-1806 - GridFsResource wrong type in javaDoc.
|
||||
* DATAMONGO-1805 - Documentation for operations.find uses wrong result type.
|
||||
* DATAMONGO-1802 - No converter found capable of converting from type org.bson.types.Binary to type byte[].
|
||||
* DATAMONGO-1795 - Remove obsolete Kotlin build configuration.
|
||||
* DATAMONGO-1793 - Release 2.0.1 (Kay SR1).
|
||||
* DATAMONGO-1696 - Reference documentation uses JPA Annotations.
|
||||
|
||||
|
||||
Changes in version 1.10.8.RELEASE (2017-10-11)
|
||||
----------------------------------------------
|
||||
* DATAMONGO-1784 - Add support for AggregationExpression in GroupOperation.sum.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Spring Data MongoDB 1.10.8
|
||||
Spring Data MongoDB 1.10.9
|
||||
Copyright (c) [2010-2015] Pivotal Software, Inc.
|
||||
|
||||
This product is licensed to you under the Apache License, Version 2.0 (the "License").
|
||||
|
||||
Reference in New Issue
Block a user