Use QuerySpec instead of QueryBuilder now. Refactored query method query building to populate CriteriaSpec and work with root QuerySpec object until the API is polished. Some test should break right now as we have to get the skip and sorting stuff into the API.
Query methods can now query for related objects of an entity. Test cases are centered around a Person having an Address. The query is something like:
List<Person> findByAddress(Address address);
We correctly marshal the parameter into a DBObject using the MongoConverter on argument binding.
Exposed the configured MongoConverter at MongoTemplate so that the repository infrastructure gets access to it. Let repository classes work with the template again instead of plain MongoOperations. Removed find(…) method from MongoOperations and -Template. Extended SimpleMongoConverter so that it can unmarshal collections as well.
- MongoRepositoryFactory now validates id type for supported types
- use MongoOperations.find(…) in SimpleMongoRepository.findById(…)
- added integration test for findById(…)
- added integration test for MongoTemplate
- improved signature of MongoReader to return an object of the type handed to it
- added convertObjectId(ObjectId id, Class targetType) to MongoConverter to delegate id conversion to the converter as well
- changed return values of some internal methods from Object to ObjectId where generally nothing else can come out of
- refactored populateIdIfNecessary(…) in MongoTemplate to use MongoConverter to convert the ObjectId created by the insert or save operation
- use field access where possible to avoid the need for setters
- introduced value objects MongoBeanWrapper and MongoPropertyDescriptor to simplify the code
- unpopulated id fields will get populated on marshaling
- support String, ObjectId and BigInteger as id types
- added find(…) method to MongoTemplate that looks up objects by type and id