如何在JHipster中使用集合类型字段创建实体? [英] How to create entity with a collection-type field in JHipster?
本文介绍了如何在JHipster中使用集合类型字段创建实体?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我们的项目中,我们使用域模型 Document .一个 document 可能有多个 titles ,因此,以我的JPA知识,我可以像这样对 Document 实体进行建模:
In our project, we work with a domain model Document. A document may have several titles, so with my JPA knowledge I'd model the Document entity like so:
@Entity
public class Document {
private Set<String> titles;
// ... getters and setters
}
我如何让jHipster生成具有集合属性(或类似地,集合字段)的实体?
How can I have jHipster generate entities with collection attributes (or, synomymously, collection fields)?
推荐答案
取决于jdl文档此处字段的收集类型尚未处理.
Depending on jdl document here the collection type for field is not handled yet.
我想您已经考虑过创建标题对象并与文档权限建立一对多关系了吗?
I guess you already think of creating an title object and create one-to-many relation with document right?
这篇关于如何在JHipster中使用集合类型字段创建实体?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文