Announcement Announcement Module
Collapse
No announcement yet.
How to embed documents in mongodb/Roo Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to embed documents in mongodb/Roo

    Hi,

    I'm using Spring roo with mongodb. My data model contains some documents which embed other documents.
    Example:

    Customer:{
    "name",
    "addresses":{
    "street",
    "city",
    "country"
    }
    }

    I've tried to do it this way : Create java bean class "Address" (without the entity tag), then create mongo Entity "Customer" where I created the attributes "name" and a Set of the class "Address".

    - Using the Roo shell, when I try to execute this command :
    field set --fieldName addresses --type ~.domain.Address

    I get this warning/error:
    The field set command is only applicable to enum, JPA @Entity or Spring Data @Persistence elements

    Isn't it the right way to do it?

    Thanks!

    Bonty
Working...
X