This commit makes sure to fall back to the configured custom converter if no more type specific converter has been registered.
Closes#3580
Original pull request: #3581.
We now only scan for entities annotated with `@Document` to avoid inclusion of non-MongoDB entities. Previously, types annotated (or meta-annotated) with `@Persistent` were included as MongoDB entity which could lead to mapping rule violations.
Closes#3592
Introduce a ConversionContext used during the mapping process to carry forward required information.
ConversionContext serves as entrpoint for recursive (read) conversion of documents, lists, maps, and simple values. The actual decision which converter strategy to apply is now encapsulated by ConversionContext.convert(…) which removes strategy duplications from the actual conversion methods.
Also, converter methods for documents, maps, lists, … are now protected for easier customization by subclasses.
Closes#3571
Original Pull Request: #3575
This commit makes sure to skip the class property ob Object when mapping maps and their keys inside an Update.
Closes#3566
Original pull request: #3577.
Reintroduce the protected ensureNotIterable method in MongoTemplate to keep the API stable. Delegate to the newly introduced method and move the collection like check to EntityOperations.
Original Pull Request: #590
Check if an object is an array or is an instance of collection or iterator instead of checking against collection names which is likely to never work.
Closes#2911
Original Pull Request: #590
We now consider the IgnoreCase part of a derived query when used along with In. Strings will be quoted to avoid malicious strings from being handed over to the server as a regular expression to evaluate.
See #3395
Original pull request: #3554.
This commit switches the rendering of UUID values to their toString format when printing org.bson.Document to json via the DocumentToString converter.
This will move the resulting representation from {"$binary": "QUK3ZihZ9cdhWjTf5TZqrw==", "$type": "03"} to 480971b0-7160-4120-acd0-6fd6b82418ad which is the more natural variant within Java applications.
The conversion only applies on read in cases where an entire document eg. a composite id, is mapped to a String property of the domain model.
Closes#3546.
Original pull request: #3551.
This commit makes sure to use an Encoder having UuidRepresentation set when calling org.bson.Document#toJson, preventing CodecConfigurationException from being raised.
Future versions will make sure the UUID string representation matches the Java default one.
Closes#3546.
Original pull request: #3551.
We now support embedded types in the sense of unwrapping nested objects into their parent Document to flatten out domain models where needed.
A domain class of:
public class User {
@Id
private String userId;
@Embedded(onEmpty = USE_NULL)
private UserName name;
}
public class UserName {
private String firstname;
private String lastname;
}
renders:
{
"_id" : "1da2ba06-3ba7",
"firstname" : "Emma",
"lastname" : "Frost"
}
Resolves#2803.
Original pull request: #896.
This commit reduces the visibility of the GeoJsonSerializersModule and instead offers static methods on GeoJsonModule allowing to obtain those via a static method.
The actual serialization was simpified by moving some of its code to a common base class.
Updated reference documentation - relates to: spring-projects/spring-data-commons#2288
We also did, by intent, not change the current GeoJsonModule to add the serializers by default in order to give users time to prepare for that change which will be done with the next major release.
Original pull request: #3539.
Closes#3517