jhipster:如何与用户实体建立一对多关系? [英] jhipster: How to create a one-to-many relationship with user entity?
问题描述
我已经使用jhipster-uml JDL脚本创建了域. 现在,我想从用户到现有实体(公司)建立O2M. 有没有办法通过JDL脚本做到这一点? 该脚本将需要重新声明关系需要的每个实体.但是这些都是现有实体,是否有一种方法可以直接使用jhipster-uml使用现有域定义,而无需再次声明它?
I have created my domain using jhipster-uml JDL script. Now I want to establish a O2M from User to an an existing entity (company). Is there a way to do that via a JDL script? The script would need to re-declare every entity the relationship needs. But these are existing entities, is there a switch to direct jhipster-uml to use the existing domain definition without the need to re-declare it again?
我只想避免使用Liquibase/Java手动设置.
I just want to avoid using the Liquibase/Java manual setup.
推荐答案
在文档
In the documentation
提示:用户实体
Tip: the User entity
请注意,由JHipster处理的User实体是 具体的. 您可以与此实体(汽车)建立多对一关系 可以与用户建立多对一关系).这将产生一个 新实体存储库中的特定查询,因此您可以过滤自己的 是当前安全用户上的实体,这是常见的要求.
Please note that the User entity, which is handled by JHipster, is specific. You can do many-to-one relationships to this entity (a Car can have a many-to-one relationship to a User). This will generate a specific query in your new entity repository, so you can filter your entity on the current security user, which is a common requirement.
似乎通过子生成器只能与User实体生成多对一关系.我不知道UML工具,但我想它只是在后台使用子生成器.
It seems only many-to-one relations can be generated with the User entity via the sub-generator. I don't know the UML tool but I guess it just use subgenerators under the hood.
您可能需要手动进行关联
You might need to do the relation manually
这篇关于jhipster:如何与用户实体建立一对多关系?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!