如何使 JHipster JDL Import 跳过重新生成现有实体

How to make JHipster JDL Import to skip regenerating existing entities

我有一个由 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 命令

升级应用程序,我也会遇到同样的问题

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

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

我有同样的错误。我删除了 .Jhipster 目录中的所有内容(json 文件)。然后我运行 jhipster jdl jhipster-jdl.jdl 一切正常!