Added necessary dependencies, repository and APT processor plugin. Added QueryDslPredicateExecutor and a QueryDsl specific sub-class of SimpleMongoRepository.
Adapted MongoRepositoryFactory to use new QueryDslRepository implementation when a repository interface extends QueryDslPredicateExecutor. Added AnnotationProcessor to create query classes from QueryDsl annotations.
Todo's left open:
- move common QueryDsl integration code into Spring Data commons (see TODOs in the sourcecode)
The MappingMongoConverter now uses TypeInformation to inspect field types and nested ones. Created overloaded versions of read(…) and write(…) to work with PersistentEntity directly so that nested calls to those methods can be distinguished from from top level ones.
Values of the registered custom types are serialized using the underlying ConversionService. This way we can plug in custom converters, e.g. for JodaTime and the like.
Adapted changes of Spring Data Commons. Implemented IndexEnsuringQueryCreationListener that creates an index for all the properties used in a query. Applies descending order by default but consideres potentially added OrderBy clauses in the query to define the order of the index attributes.
In a repository for a particular domain type we might want to query for nested documents directly and thus also return those nested documents. As the collection to be queried is determined by the domain class, this one might differ from the object the result has to be unmarshalled to.
Using field access for populating objects in SimpleMongoConverter causes trouble when the class to be persisted contains a business getter without any parameters. This causes a PropertyDescriptor to be created for that method without a field actually backing it. So I manually catch NotWriteablePropertyException now to simply skip those invalid properties.