morphia
morphia copied to clipboard
Mapping nested objects to property using dot notation
Hello,
This is a feature request.
When mapping documents to POJO's, it would be nice to use the @Property
annotation to map nested documents using dot notation. For example;
Document
{
name: "morphia",
meta: {
version: "1.1.1"
}
}
POJO
class Document {
private String name;
@Property("meta.version")
private String version;
}
This would avoid having to model deeply nested documents with a lot of boilerplate code.
~~+1~~
Edit: @kevbradwick: If you haven't already, I think you might want to look into the Embedded Annotation It's not as "slim" as using dot-notation, but it's definitely cleaner and less brittle to provide proper abstractions for nested documents.