【问题标题】:Generating entity in Jhipster Module在 Jhipster 模块中生成实体
【发布时间】:2023-03-04 15:29:01
【问题描述】:

我正在编写一个 Jhipster 生成器模块,我需要搭建一个新实体。就像在生成器 javascript 中运行 jhipster:entity 一样

我应该怎么做?我在基本生成器方法“addEntityToCache(...)”、“addEntityToMenu(...)”中看到。但我没有看到:“addEntity(definition)”,其中定义是存储在 .jhipster 中的配置 json

这个功能可以吗?我可以扩展实体子生成器以重用代码吗?

【问题讨论】:

    标签: jhipster yeoman-generator


    【解决方案1】:

    在 project/.jhipster 中创建 entity.json 文件

    { “fluentMethods”:是的,

    "relationships": [],
    "fields": [
        {
            "fieldName": "field_name_in_pojo_class",
            "fieldType": "data_type_of_that_field"
        }
    ],
    "changelogDate": "20180523121144",
    "dto": "no",
    "service": "serviceClass",
    "entityTableName": "entity_name_here",
    "jpaMetamodelFiltering": false,
    "pagination": "pagination",
    "microserviceName": "project_name_here",
    "searchEngine": false
    

    }

    【讨论】:

    • 但是,我如何从我的模块中触发“jhipster:entity myentity”?我想在代码生成后在资源控制器中添加代码。
    猜你喜欢
    • 1970-01-01
    • 2016-10-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-09-18
    • 1970-01-01
    • 2017-08-26
    • 2016-07-20
    相关资源
    最近更新 更多