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

问题描述 投票:1回答:1

[当我尝试在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) "

我找不到说“您的枚举的类名是什么?”的问题]

我在Windows 10上使用openjdk 11.0.7,节点v12.16.3

jhipster
1个回答
1
投票

这很可能是JHipster 6.9.0的回归,我已经能够在6.9.0中重现它,而在6.8.0中则可以正常工作。

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

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

或者,您可以使用JDL,我在6.9.0中对其进行了测试,它可以正常工作,创建如下所示的entities.jdl文件(请参见https://www.jhipster.tech/jdl/),然后使用jhipster import-jdl entities.jdl导入它>

enum Categorie {
  ONE, TWO
}


entity Produit {
  categorie Categorie
}
© www.soinside.com 2019 - 2024. All rights reserved.