|
22 | 22 | import org.springframework.core.convert.converter.Converter;
|
23 | 23 | import org.springframework.data.mapping.Association;
|
24 | 24 | import org.springframework.data.mapping.context.MappingContext;
|
25 |
| -import org.springframework.data.mongodb.core.mapping.BasicMongoPersistentEntity; |
26 | 25 | import org.springframework.data.mongodb.core.mapping.MongoPersistentEntity;
|
27 | 26 | import org.springframework.data.mongodb.core.mapping.MongoPersistentProperty;
|
28 | 27 | import org.springframework.data.mongodb.core.mapping.MongoPersistentProperty.PropertyToFieldNameConverter;
|
@@ -67,8 +66,8 @@ public UpdateMapper(MongoConverter converter) {
|
67 | 66 | */
|
68 | 67 | @Override
|
69 | 68 | protected Object delegateConvertToMongoType(Object source, MongoPersistentEntity<?> entity) {
|
70 |
| - return entity == null ? super.delegateConvertToMongoType(source, null) : converter.convertToMongoType(source, |
71 |
| - getTypeHintForEntity(source, entity)); |
| 69 | + return converter.convertToMongoType(source, |
| 70 | + entity == null ? ClassTypeInformation.OBJECT : getTypeHintForEntity(source, entity)); |
72 | 71 | }
|
73 | 72 |
|
74 | 73 | /*
|
@@ -200,18 +199,6 @@ public MetadataBackedUpdateField(MongoPersistentEntity<?> entity, String key,
|
200 | 199 | this.key = key;
|
201 | 200 | }
|
202 | 201 |
|
203 |
| - @Override |
204 |
| - @SuppressWarnings({ "rawtypes", "unchecked" }) |
205 |
| - public MongoPersistentEntity<?> getPropertyEntity() { |
206 |
| - |
207 |
| - MongoPersistentEntity<?> entity = super.getPropertyEntity(); |
208 |
| - if (entity != null || getProperty() == null) { |
209 |
| - return entity; |
210 |
| - } |
211 |
| - |
212 |
| - return new BasicMongoPersistentEntity(getProperty().getTypeInformation()); |
213 |
| - } |
214 |
| - |
215 | 202 | /*
|
216 | 203 | * (non-Javadoc)
|
217 | 204 | * @see org.springframework.data.mongodb.core.convert.QueryMapper.MetadataBackedField#getMappedKey()
|
|
0 commit comments