gpt4 book ai didi

jhipster - 如何创建实体与自身的关系?例如,分层文件夹

转载 作者:行者123 更新时间:2023-12-05 06:43:10 27 4
gpt4 key购买 nike

我正在尝试创建分层文件夹结构。这是我的文件夹实体:

$ yo jhipster:entity Folder
The entity Folder is being created.
Generating field #1
? Do you want to add a field to your entity? Yes
? What is the name of your field? name
? What is the type of your field? String
? Do you want to add validation rules to your field? No
=================Folder=================
name (String)
Generating field #2
? Do you want to add a field to your entity? Yes
? What is the name of your field? parentId
? What is the type of your field? Long
? Do you want to add validation rules to your field? No
=================Folder=================
name (String)
parentId (Long)
Generating field #3
? Do you want to add a field to your entity? No
=================Folder=================
name (String)
parentId (Long)

我正试图找出我需要提供 jhipster 的实体生成器以使其工作的东西。这是我目前所拥有的...

Generating relationships with other entities
? Do you want to add a relationship to another entity? Yes
? What is the name of the other entity? Folder
? What is the name of the relationship? parent
? What is the type of the relationship? one-to-many
? What is the name of this relationship in the other entity? child

我走在正确的轨道上吗?如何创建子多对一关系?如果我尝试使用 Folder 实体创建它,我会收到警告。之后无法生成它。

最佳答案

您可以使用 https://jhipster.github.io/jdl-studio/用于编写 jdl 以创建实体。请访问https://jhipster.github.io/jhipster-uml/#jdl想要查询更多的信息。这是一个与自身有关系的示例 JDL:

entity RankProperties {
rank Integer required,
minExp Integer required,
maxExp Integer required,
maxStamina Integer required,
maxAlly Integer required,
maxTeam Integer required
}
enum TaskMode {
NO_CONTINUE_STAGE_COUNT,
STAGE_COUNT,
STAGE_ID
}

entity Task {
taskMode TaskMode required,
value Integer required
}

relationship ManyToOne {
Task{parent} to Task
}

dto all with mapstruct
service all with serviceClass

关于jhipster - 如何创建实体与自身的关系?例如,分层文件夹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34321905/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com