METAMODEL-92: Added support for resolving nested values in document-based datacontext implementations
Review Request #27742 - Created Nov. 7, 2014 and submitted
| Information | |
|---|---|
| Kasper Sørensen | |
| metamodel | |
| METAMODEL-92 | |
| Reviewers | |
| MetaModel | |
This patch makes it possible to specify column names with "paths" in document-based data stores such as JSON files, MongoDB and CouchDB. The path format is similar to that of EL/JavaScript syntax. It supports traversing maps and lists/arrays. Here's an example of a few expressions:
- address.city
- addresses[0].city
- person.addresses[1].country.code
And so on...
I added the path based resolving method ("find(...)") to CollectionUtils - seemed like the most appropriate place, and it makes it broadly reusable since it is in the core module.
Added unittests of path traversal (CollectionUtilsTest).
Added unittests for application to JSON files (JsonDataContextTest)
Added integration tests for MongoDB and CouchDB application (MongoDbDataContextTest and CouchDbDataContextTest)