在 jhipster 上创建新实体时无法选择类型枚举

can't choose type enumeration while creating new entity on jhipster

当我尝试在 jhipster 上创建一个新实体时,如果我选择添加一个枚举类型的字段,我会遇到这个问题:

The entity Produit is being created.
The entity Produit is being created.

Generating field #1

? Do you want to add a field to your entity? Yes
? What is the name of your field? categorie
? What is the type of your field? Enumeration (Java enum type)
? Do you want to add validation rules to your field? (y/N) "

我找不到 "what is the class name of your enumeration?"

的问题

我在 windows 10

上使用 openjdk 11.0.7,节点 v12.16.3

这很可能是 JHipster 6.9.0 的回归,我已经能够在 6.9.0 中重现它,而它在 6.8.0 中运行良好。

您应该在 github 上报告此问题; https://github.com/jhipster/generator-jhipster/issues

作为解决方法,您可以使用 npm install -g generator-jhipster@6.8.0 安装 6.8.0 并从一个空目录启动一个新项目,因为 jhipster 6.9.0 已经本地安装在您当前的项目目录中。

或者你可以使用 JDL,我在 6.9.0 中测试过它,它工作正常,创建一个如下所示的 entities.jdl 文件(参见 https://www.jhipster.tech/jdl/),然后使用 [=13= 导入它]

enum Categorie {
  ONE, TWO
}


entity Produit {
  categorie Categorie
}