@ -249,7 +249,6 @@ public class MappingMongoConverter extends AbstractMongoConverter implements App
@@ -249,7 +249,6 @@ public class MappingMongoConverter extends AbstractMongoConverter implements App
private ParameterValueProvider < MongoPersistentProperty > getParameterProvider ( MongoPersistentEntity < ? > entity ,
DocumentAccessor source , SpELExpressionEvaluator evaluator , ObjectPath path ) {
AssociationAwareMongoDbPropertyValueProvider provider = new AssociationAwareMongoDbPropertyValueProvider ( source ,
evaluator , path ) ;
PersistentEntityParameterValueProvider < MongoPersistentProperty > parameterProvider = new PersistentEntityParameterValueProvider < > (
@ -288,8 +287,7 @@ public class MappingMongoConverter extends AbstractMongoConverter implements App
@@ -288,8 +287,7 @@ public class MappingMongoConverter extends AbstractMongoConverter implements App
// Make sure id property is set before all other properties
Object rawId = readAndPopulateIdentifier ( accessor , documentAccessor , entity ,
path , evaluator ) ;
Object rawId = readAndPopulateIdentifier ( accessor , documentAccessor , entity , path , evaluator ) ;
ObjectPath currentPath = path . push ( accessor . getBean ( ) , entity , rawId ) ;
MongoDbPropertyValueProvider valueProvider = new MongoDbPropertyValueProvider ( documentAccessor , evaluator ,
@ -621,7 +619,7 @@ public class MappingMongoConverter extends AbstractMongoConverter implements App
@@ -621,7 +619,7 @@ public class MappingMongoConverter extends AbstractMongoConverter implements App
return ;
}
MongoPersistentEntity < ? > entity = isSubtype ( prop . getType ( ) , obj . getClass ( ) )
MongoPersistentEntity < ? > entity = valueType . isSubTypeOf ( prop . getType ( ) )
? mappingContext . getRequiredPersistentEntity ( obj . getClass ( ) )
: mappingContext . getRequiredPersistentEntity ( type ) ;
@ -633,10 +631,6 @@ public class MappingMongoConverter extends AbstractMongoConverter implements App
@@ -633,10 +631,6 @@ public class MappingMongoConverter extends AbstractMongoConverter implements App
accessor . put ( prop , document ) ;
}
private boolean isSubtype ( Class < ? > left , Class < ? > right ) {
return left . isAssignableFrom ( right ) & & ! left . equals ( right ) ;
}
/ * *
* Returns given object as { @link Collection } . Will return the { @link Collection } as is if the source is a
* { @link Collection } already , will convert an array into a { @link Collection } or simply create a single element
@ -1013,9 +1007,8 @@ public class MappingMongoConverter extends AbstractMongoConverter implements App
@@ -1013,9 +1007,8 @@ public class MappingMongoConverter extends AbstractMongoConverter implements App
Assert . notNull ( targetType , "Target type must not be null!" ) ;
Assert . notNull ( path , "Object path must not be null!" ) ;
Class < ? > collectionType = targetType . getType ( ) ;
collectionType = Collection . class . isAssignableFrom ( collectionType ) //
? collectionType //
Class < ? > collectionType = targetType . isSubTypeOf ( Collection . class ) //
? targetType . getType ( ) //
: List . class ;
TypeInformation < ? > componentType = targetType . getComponentType ( ) ! = null //