【问题标题】:How to make JHipster JDL Import to skip regenerating existing entities如何使 JHipster JDL Import 跳过重新生成现有实体
【发布时间】:2021-07-20 16:13:45
【问题描述】:

我有一个由 JHipster 6.7.0 生成的 Monolith 应用程序。我的 JHipster 本地版本是 7.0.1。当我尝试使用 jhipster import-jdl app.jdl 命令导入新实体时,我遇到了与已经可用的实体有关的问题。

ERROR! Error at entity Ticket: relationship name is not synchronized {
   "relationshipName": "jobs",
   "otherEntityName": "ticketJob",
   "relationshipType": "one-to-many",
   "otherEntityRelationshipName": "ticket",
   "otherEntity": "[TicketJob Entity]",
   "otherEntityField": "id",
   "ownerSide": false,
   "collection": true,
   "otherSideReferenceExists": false,
   "otherEntityIsEmbedded": false
} with {
   "relationshipName": "ticket",
   "otherEntityName": "ticket",
   "relationshipType": "many-to-one",
   "otherEntityField": "id",
   "otherEntityRelationshipName": "ticketJob",
   "otherEntity": "[Ticket Entity]",
   "ownerSide": true,
   "collection": false,
   "otherSideReferenceExists": false,
   "otherEntityIsEmbedded": false,
   "relatedField": {
       "fieldName": "id",
       "id": true,
       "fieldNameHumanized": "ID",
       "fieldTranslationKey": "global.field.id",
       "autoGenerate": true,
       "dynamic": false,
       "fieldType": "Long",
       "fieldNameCapitalized": "Id",
       "fieldNameUnderscored": "id",
       "tsType": "number",
       "entity": "[Ticket Entity]",
       "jpaGeneratedValue": "sequence",
       "readonly": true,
       "fieldIsEnum": false,
       "fieldWithContentType": false,
       "fieldNameAsDatabaseColumn": "id",
       "columnName": "id",
       "fieldInJavaBeanMethod": "Id",
       "fieldValidate": false,
       "nullable": true,
       "unique": false,
       "uniqueValue": [],
       "path": [
           "id"
       ],
       "relationshipsPath": [],
       "reference": "[id Reference]",
       "relatedByOtherEntity": true
   } 

是否可以在导入新版本的新实体时跳过现有实体?还是更容易将现有实体升级到最新版本? (即使我尝试使用 jhipster upgrade 命令升级应用程序,我也会遇到同样的问题

【问题讨论】:

    标签: java spring jhipster jdl


    【解决方案1】:

    问题在于.Jhipster 目录中的 JSON 文件。每当我们升级 JHipster 或导入新实体时,JHipster 都会使用 .JHipster 目录中的 JSON 文件运行整个实体。

    我无法获得确切的解决方案,但我确实设法找到了解决方案。我刚刚创建了一个正在创建问题的新实体。我导入了为实体生成新 JSON 文件的实体。我忽略了在导入这个新的 JDL 文件时创建的其他文件。之后,我就可以升级 JHipster 项目了。

    【讨论】:

      猜你喜欢
      • 2018-10-04
      • 2016-10-06
      • 2016-10-30
      • 2021-01-14
      • 1970-01-01
      • 2017-10-21
      • 2018-06-29
      • 1970-01-01
      相关资源
      最近更新 更多