morphia icon indicating copy to clipboard operation
morphia copied to clipboard

Embedded annotation documentation bug

Open yeefan opened this issue 12 years ago • 3 comments

I refer to the following page: https://github.com/mongodb/morphia/wiki/EmbeddedAnnotation There is this line: "We just annotate the above classes with @Property and @Embedded" Problem is, @Property is never found anywhere else on this page.

Additionally, it seems that the @Embedded annotation was never needed at the first place. If a class C has no annotations, and a document D contains an unannotated field of class C, then the instance of class C gets embedded into the document D when saved into the database.

yeefan avatar Sep 25 '14 15:09 yeefan

I agree that the lack of the @Property annotation is confusing.

With regards to the @Embedded annotation, like @Property it's not required, but allows users to specify non-default behaviour if necessary (e.g. if the field name in the database is different to field name in the class).

I believe you're suggesting this documentation could cover more specifically when/why you would use these annotations?

trishagee avatar Sep 25 '14 15:09 trishagee

Thanks. To your question, yes. I suppose it might be useful as a tool to annotate the code, but this could be more explicit.

yeefan avatar Sep 25 '14 15:09 yeefan

updated the bottom of the page with some text discussing the optional nature of the annotation.

evanchooly avatar Feb 20 '15 19:02 evanchooly