【问题标题】:can't choose type enumeration while creating new entity on jhipster在 jhipster 上创建新实体时无法选择类型枚举
【发布时间】:2020-05-24 11:08:39
【问题描述】:

当我尝试在 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】:

    这很可能是 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/),然后使用 jhipster import-jdl entities.jdl 导入它

    enum Categorie {
      ONE, TWO
    }
    
    
    entity Produit {
      categorie Categorie
    }
    

    【讨论】:

    • 我目前也面临这个问题。
    • 谢谢,它在 6.8.0 版本上运行良好。我已经尝试使用 import-jdl 命令,但是生成器在使用绝对路径时找不到文件位置
    • 对于 jdl 的位置,它取决于你使用哪个 shell,如果你使用 powershell :jhipster import-jdl .\entities.jdl 工作正常
    猜你喜欢
    • 2022-08-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多