【发布时间】:2017-07-09 16:15:05
【问题描述】:
我正在尝试使用 MongoDB 数据库的 JHipster。对于我的示例,我想存储书籍。为此,我想使用 JDL 格式来生成实体、存储库、服务、dtos……
这是我的实际 JDL 文件: 它有效:
entity Book {
name String required
date LocalDate required
}
dto all with mapstruct
paginate all with pager
service all with serviceImpl
现在,我想补充一点,Book 可以由 Author 编写。
我可以添加一个实体Author:
entity Author {
firstane String required
lastname LocalDate required
}
我的具体问题是:如何关联Author 和Book?
文档中有这个例子:
relationship OneToMany {
Author{book} to Book{writer(name) required}
}
但这不起作用,因为 NoSQL 数据库不支持关系。那么,我该如何实现呢?
谢谢。
【问题讨论】:
-
从jdl导入时可以在mongodb的数据库中生成collection吗?