JHipster : Generate MongoDB entities with JHipster Domain Language (JDL)

Viewed 3523

I'm trying JHipster with a MongoDB database. For my example I would like to store Books. To do that I would like to use the JDL format to be able to generate entities, repositories, services, dtos…

This is my actual JDL file: And it works :

entity Book {
    name String required
    date LocalDate required
}

dto all with mapstruct
paginate all with pager
service all with serviceImpl

Now, I would like to add the notion that a Book can be written by an Author.

I can add an entity Author:

entity Author {
        firstane String required
        lastname LocalDate required
    }

My specific question is: How can I associate an Author and a Book?

The documentation has this example :

relationship OneToMany {
  Author{book} to Book{writer(name) required}
}

But that's not working because NoSQL databases don't support relationships. So, how can I achieve that ?

Thanks.

1 Answers
Related