Announcement Announcement Module
No announcement yet.
Roo, MongoDB, and embedded objects Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Roo, MongoDB, and embedded objects

    Is it possible to create an entity that has embeddable objects that are not entities themselves? I have the need to create a "report" entity which contains multiple other objects. For example, the class may look like:

    class MyReport {
    String name;
    String dateCreated;
    Narrative narrative; // this is another class
    List<ReportPart> reportParts;

    I tried to create the Narrative object in the Roo shell using embeddable, but that only appears to be available for JPA projects (I'm using MongoDB). I can achieve this using separate entities, but I don't want to do that, as the narrative and reportParts would never be used independently and are only used once within the report. Also, I've greatly simplified the example, as the real class has many more nested objects that are all used only within the enclosing report class.

    Any help on how this can be done in Roo would be helpful, OR, whatever source code changes could be done to enable this capability. I've read about @embeddable and @embedded in Hibernate, but I'm not sure Hibernate is still being used under the covers here.