Skip to content

import-jdl doesn't generate code for new entities when adding new entities to the .jdl  #26380

@naris

Description

@naris
Overview of the issue

When I add new entities to the jdl file, after migrating the project to jhipster 8.5.2 from jhipster 7.9.4 and earlier, it will no longer actually generate any source files for the new entities. It only generates source for the old entities even though it does generate .json files for the new entities in the .jhipster directory and includes the new entities in the list of entities it is supposedly generating in the INFO! message. It does not generate any domain .java classes or entities typescript .ts classes for the new entities but it does re-generate that code for all the old entities.

Also, since I had used the jhipster-migrate plugin it now complains that: ERROR! ERROR! The installed generator-jhipster-migrate blueprint targets JHipster v8.3.0 and is not compatible with this JHipster version. Even if I update the jhipster-migrate plugin it still complains.

Also, the new entities have a relation to User (specified with with) and there is a warning that "you have defined an empty jhiPrefix", which is supposed to default to jhi, even if I do specify jhiPrefix by passing --jhi-prefix jhi and/or adding jhiPrefix to the jdl in application:config.

WARNING! The field name 'user' is regarded as a reserved keyword, but you have defined an empty jhiPrefix. This might lead to a non-working application.

This is the output I get when running jhipster import-jdl .\src\main\resources\jdl\TotalFact.jdl --skip-checks with 2 new entities (Collection & CollectionGroup) defined in in the totalfact.jdl file.

I have zipped a copy of the project and attached it

Motivation for or Use Case

This used to work before, I had added many entities to the jdl and it had always generated Java classes for the backend and typescript code for the front end.

Reproduce the error

Using the attached zipped project, run jhipster import-jdl .\src\main\resources\jdl\TotalFact.jdl. You will have to add --skip-checks to actually generate code due to the issue mentioned above with the jhipster-migrate plugin

Related issues
Suggest a Fix
JHipster Version(s)

8.5.0

JHipster configuration
.yo-rc.json file
{
  "generator-jhipster": {
    "applicationType": "monolith",
    "authenticationType": "oauth2",
    "baseName": "TotalFact",
    "blueprints": [
      {
        "name": "generator-jhipster-migrate",
        "version": "1.0.0"
      }
    ],
    "buildTool": "maven",
    "cacheProvider": "infinispan",
    "clientFramework": "angularX",
    "clientPackageManager": "npm",
    "clientTheme": "none",
    "clientThemeVariant": "",
    "creationTimestamp": 1651244671759,
    "databaseType": "sql",
    "devDatabaseType": "oracle",
    "devServerPort": 4200,
    "dtoSuffix": "DTO",
    "enableGradleEnterprise": false,
    "enableHibernateCache": true,
    "enableSwaggerCodegen": true,
    "enableTranslation": true,
    "entities": [
      "UPC",
      "UPCRule",
      "PlatformType",
      "Platform",
      "PlatformDE",
      "PlatformInst",
      "PlatformList",
      "Product",
      "Release",
      "Dimension",
      "Category",
      "Attribute",
      "Section",
      "FieldValue",
      "Task",
      "Step",
      "PrivateNotes",
      "ProtectedClass",
      "Derivation",
      "SourceType",
      "Universe",
      "EpsilonDataSource",
      "Usage",
[totalfact-4.zip](https://github.com/user-attachments/files/15743661/totalfact-4.zip)
  "Royalty"
],
"entitySuffix": "",
"incrementalChangelog": true,
"jhiPrefix": "jhi",
"jhipsterVersion": "8.5.0",
"languages": [
  "en"
],
"lastLiquibaseTimestamp": 1704384539000,
"messageBroker": false,
"microfrontend": false,
"microfrontends": [],
"nativeLanguage": "en",
"otherModules": [
  {
    "name": "generator-jhipster-primeng-blueprint",
    "version": "7.0.4"
  }
],
"packageFolder": "com/epsilon/totalfact",
"packageName": "com.epsilon.totalfact",
"pages": [],
"prodDatabaseType": "oracle",
"reactive": false,
"searchEngine": false,
"serverPort": "8080",
"serverSideOptions": [
  "enableSwaggerCodegen:true"
],
"serviceDiscoveryType": "no",
"skipCheckLengthOfIdentifier": false,
"skipClient": false,
"skipFakeData": false,
"skipUserManagement": true,
"syncUserWithIdp": false,
"testFrameworks": [
  "gatling"
],
"websocket": false,
"withAdminUi": true

}
}

Environment and Tools

openjdk version "17.0.6" 2023-01-17 LTS
OpenJDK Runtime Environment Microsoft-7209853 (build 17.0.6+10-LTS)
OpenJDK 64-Bit Server VM Microsoft-7209853 (build 17.0.6+10-LTS, mixed mode, sharing)

git version 2.40.1.windows.1

node: v18.20.1
npm: 10.5.0

'docker' command could not be found

JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory
JDL entity definitions
@ChangelogDate("20220525172737")
entity UPC {
  upcKey String maxlength(15)
  name String maxlength(250) required
  description String maxlength(1024)
  dataSource TextBlob
  keywords TextBlob
  userNotes TextBlob
  restrictedResellerFlag Boolean
  hidden Boolean
  createUser String required
  createDate Instant required
  modifyUser String
  modifyDate Instant
}
@ChangelogDate("20220525172738")
entity UPCRule (upc_rule) {
  ruleText TextBlob required
  ruleDate Instant required
  createUser String
  createDate Instant
  modifyUser String
  modifyDate Instant
}
@ChangelogDate("20220525172739")
entity PlatformType {
  name String maxlength(10) required
  description String
}
@ChangelogDate("20220525172740")
entity Platform {
  primarySymbol String maxlength(128) required
  fieldName String maxlength(250) required
  fieldDescription String maxlength(1024)
  fieldLength Integer
  fieldValue String maxlength(100)
  shortHeaderName String maxlength(10)
  longHeaderName String maxlength(200)
  inUse Boolean
  premiumField Boolean
  approvalRequired Boolean
  royalty Boolean
  token String maxlength(50)
  sasKey String maxlength(10)
  rateId String maxlength(10)
  countType String maxlength(1)
  kvp String maxlength(50)
  caseable Boolean
  sanRequired Boolean
  waiverRequired Boolean
  createUser String
  createDate Instant
  modifyUser String
  modifyDate Instant
}
@ChangelogDate("20220525172741")
entity PlatformDE (platform_de) {
  ecapsKey Integer
  defaultValue String maxlength(10)
  usedInBilling Boolean
  displayZeroCounts Boolean
  areaFillinRequired Boolean
  createUser String
  createDate Instant
  modifyUser String
  modifyDate Instant
}
@ChangelogDate("20220525172742")
entity PlatformInst {
  pricingFlag Boolean
  selectFlag Boolean
  outputFlag Boolean
  crosstabFlag Boolean
  createUser String
  createDate Instant
  modifyUser String
  modifyDate Instant
}
@ChangelogDate("20220525172743")
entity PlatformList {
  pricingFlag Boolean
  selectFlag Boolean
  outputFlag Boolean
  crosstabFlag Boolean
  createUser String
  createDate Instant
  modifyUser String
  modifyDate Instant
}
@ChangelogDate("20220525172744")
entity Product {
  name String
  description String
  productKey Integer min(0) max(999)
  createUser String
  createDate Instant
  modifyUser String
  modifyDate Instant
}
@ChangelogDate("20220525172745")
entity Release {
  version String
  releaseDate Instant
}
@ChangelogDate("20220525172746")
entity Dimension {
  name String maxlength(128) required
  description String
  createUser String required
  createDate Instant required
  modifyUser String
  modifyDate Instant
}
@ChangelogDate("20220525172747")
entity Category {
  name String maxlength(128) required
  createUser String required
  createDate Instant required
  modifyUser String
  modifyDate Instant
}
@ChangelogDate("20220525172748")
entity Attribute {
  fieldLevel String maxlength(128)
  createUser String required
  createDate Instant required
  modifyUser String
  modifyDate Instant
}
@ChangelogDate("20220525172750")
entity Section {
  sectionKey String maxlength(10) required
  name String maxlength(128) required
  selfReported Boolean
  modeled Boolean
  thirdParty Boolean
  areaLevel Boolean
  compiled Boolean
  updatedDaily Boolean
  updatedWeekly Boolean
  updatedBiWeeekly Boolean
  updatedMonthly Boolean
  updatedSixWeeeks Boolean
  updatedQuatrerly Boolean
  updatedSemiAnnually Boolean
  createUser String
  createDate Instant
  modifyUser String
  modifyDate Instant
}
@ChangelogDate("20220525172751")
entity FieldValue {
  fieldValue String maxlength(25) required
  valueDefinition String
  averageMatchRate Float min(0) max(100)
  displayOrder Integer
  activeFlag Boolean
  createUser String
  createDate Instant
  modifyUser String
  modifyDate Instant
}
@ChangelogDate("20220525172752")
entity Task {
  name String required
  taskUser String maxlength(25) required
  taskOrder Integer
  showOnMainPage Boolean
  createUser String
  createDate Instant
  modifyUser String
  modifyDate Instant
}
@ChangelogDate("20220525172753")
entity Step {
  completed Boolean
  notes TextBlob
  createUser String
  createDate Instant
  modifyUser String
  modifyDate Instant
}
@ChangelogDate("20220614152213")
entity PrivateNotes {
  noteText TextBlob
  noteDate Instant required
  createUser String
  createDate Instant
  modifyUser String
  modifyDate Instant
}
@ChangelogDate("20220614152214")
entity ProtectedClass {
  code Integer min(0) max(9) required
  name String maxlength(128)
  description String maxlength(1024)
}
@ChangelogDate("20220614152215")
entity Derivation {
  code String maxlength(10) required
  name String maxlength(128)
  description String maxlength(1024)
}
@ChangelogDate("20220722180825")
entity SourceType {
  code String maxlength(10) required
  name String maxlength(128)
  description String maxlength(1024)
}
@ChangelogDate("20220831162820")
entity Universe {
  code String maxlength(10) required
  name String maxlength(128) required
}
@ChangelogDate("20220831162821")
entity EpsilonDataSource {
  name String maxlength(128)
}
@ChangelogDate("20230213200839")
entity Usage (jhi_usage) {
  action String required
  parm String
  user String maxlength(25) required
  dateTime Instant required
}
@ChangelogDate("20240104160857")
entity Royalty {
  name String maxlength(10) required
  description String
}

relationship OneToOne {
  PlatformDE{platform} to Platform{de}
  PlatformInst{platform} to Platform{install}
  PlatformList{platform} to Platform{list}
}
relationship OneToMany {
  UPC{rules} to UPCRule{upc required}
  UPC{privateNotes} to PrivateNotes{upc required}
  UPC{platforms required} to Platform{upc required}
  UPC{steps} to Step{uPC}
  Platform{values required} to FieldValue{platform}
  Dimension{categories required} to Category{dimension}
  Category{platform} to Platform{category}
}
relationship ManyToOne {
  UPC{attribute required} to Attribute
  UPC{category required} to Category
  UPC{protectedClass} to ProtectedClass
  UPC{epsilonDataSource} to EpsilonDataSource
  UPC{royalty} to Royalty
  Platform{release} to Release
  Platform{platformType} to PlatformType
  PlatformDE{section} to Section
  Product{platformType} to PlatformType
  Dimension{universe} to Universe
  Step{task} to Task
}
relationship ManyToMany {
  UPC{sourceType} to SourceType{upc}
  UPC{derivation} to Derivation{upc}
  Platform{product} to Product{platform}
}

paginate UPC, UPCRule, PlatformType, Platform, PlatformDE, PlatformInst, PlatformList, Product, Release, Dimension, Category, Attribute, Section, FieldValue, Task, Step, PrivateNotes, ProtectedClass, Derivation, SourceType, Universe, EpsilonDataSource, Usage, Royalty with pagination
service UPC, UPCRule, PlatformType, Platform, PlatformDE, PlatformInst, PlatformList, Product, Release, Dimension, Category, Attribute, Section, FieldValue, Task, Step, PrivateNotes, ProtectedClass, Derivation, SourceType, Universe, EpsilonDataSource, Usage, Royalty with serviceClass
search UPC, UPCRule, PlatformType, Platform, PlatformDE, PlatformInst, PlatformList, Product, Release, Dimension, Category, Attribute, Section, FieldValue, Task, Step, PrivateNotes, ProtectedClass, Derivation, SourceType, Universe, EpsilonDataSource, Usage, Royalty with no
filter UPC, UPCRule, PlatformType, Platform, PlatformDE, PlatformInst, PlatformList, Product, Release, Dimension, Category, Attribute, Section, FieldValue, Task, Step, PrivateNotes, ProtectedClass, Derivation, SourceType, Universe, EpsilonDataSource, Usage, Royalty

--- If you have a JDL please wrap it in below structure
JDL definitions
@filter
@paginate(pagination)
entity UPC {
    upcKey String maxlength(15)
    name String maxlength(250) required
    description String maxlength(1024)
    dataSource TextBlob
    keywords TextBlob
    userNotes TextBlob
    restrictedResellerFlag Boolean
    hidden Boolean
    createUser String required
    createDate Instant required
    modifyUser String
    modifyDate Instant
}

@filter
@paginate(pagination)
entity UPCRule {
ruleText TextBlob required
ruleDate Instant required
createUser String
createDate Instant
modifyUser String
modifyDate Instant
}

@filter
@paginate(pagination)
entity PrivateNotes {
noteText TextBlob
noteDate Instant required
createUser String
createDate Instant
modifyUser String
modifyDate Instant
}

/*
DE (DE),
INSTALL (Install),
LIST (List),
ONLINE (Online),
*/
@filter
@paginate(pagination)
entity PlatformType {
name String maxlength(10) required
description String
}

/*
ALL "Royalty for All platforms"
INDIRECT "Royalty – Indirect Only (categories: Ethnic, DMA, CMV with qualifiers)"
INSTALL "Royalty – Install only ( NCA 2.0)"
PENDING "Pending Review"
*/
@filter
@paginate(pagination)
entity Royalty {
name String maxlength(10) required
description String
}

@filter
@paginate(pagination)
entity Platform {
primarySymbol String maxlength(128) required
fieldName String maxlength(250) required
fieldDescription String maxlength(1024)
fieldLength Integer
fieldValue String maxlength(100)
shortHeaderName String maxlength(10)
longHeaderName String maxlength(200)
inUse Boolean
premiumField Boolean
approvalRequired Boolean
royalty Boolean // TODO: Remove after updating data
token String maxlength(50)
sasKey String maxlength(10)
rateId String maxlength(10)
countType String maxlength(1)
kvp String maxlength(50)
caseable Boolean
sanRequired Boolean
waiverRequired Boolean
createUser String
createDate Instant
modifyUser String
modifyDate Instant
}

@filter
@paginate(pagination)
entity PlatformDE {
ecapsKey Integer
defaultValue String maxlength(10)
usedInBilling Boolean
displayZeroCounts Boolean
areaFillinRequired Boolean
createUser String
createDate Instant
modifyUser String
modifyDate Instant
}

@filter
@paginate(pagination)
entity PlatformInst {
pricingFlag Boolean
selectFlag Boolean
outputFlag Boolean
crosstabFlag Boolean
createUser String
createDate Instant
modifyUser String
modifyDate Instant
}

@filter
@paginate(pagination)
entity PlatformList {
pricingFlag Boolean
selectFlag Boolean
outputFlag Boolean
crosstabFlag Boolean
createUser String
createDate Instant
modifyUser String
modifyDate Instant
}

@filter
@paginate(pagination)
entity Product {
name String
description String
productKey Integer min(0) max(999)
createUser String
createDate Instant
modifyUser String
modifyDate Instant
}

@filter
@paginate(pagination)
entity Release {
version String
releaseDate Instant
}

@filter
@paginate(pagination)
entity Dimension {
name String maxlength(128) required
description String
createUser String required
createDate Instant required
modifyUser String
modifyDate Instant
}

@filter
@paginate(pagination)
entity Category {
name String maxlength(128) required
createUser String required
createDate Instant required
modifyUser String
modifyDate Instant
}

@filter
@paginate(pagination)
entity Universe {
code String maxlength(10) required
name String maxlength(128) required
}

@filter
@paginate(pagination)
entity Attribute {
fieldLevel String maxlength(128)
createUser String required
createDate Instant required
modifyUser String
modifyDate Instant
}

@filter
@paginate(pagination)
entity Section {
sectionKey String maxlength(10) required
name String maxlength(128) required
selfReported Boolean
modeled Boolean
thirdParty Boolean
areaLevel Boolean
compiled Boolean
updatedDaily Boolean
updatedWeekly Boolean
updatedBiWeeekly Boolean
updatedMonthly Boolean
updatedSixWeeeks Boolean
updatedQuatrerly Boolean
updatedSemiAnnually Boolean
createUser String
createDate Instant
modifyUser String
modifyDate Instant
}

@filter
@paginate(pagination)
entity FieldValue {
fieldValue String maxlength(25) required
valueDefinition String
averageMatchRate Float min(0) max(100)
displayOrder Integer
activeFlag Boolean
createUser String
createDate Instant
modifyUser String
modifyDate Instant
}

@filter
@paginate(pagination)
entity Task {
name String required
taskUser String maxlength(25) required
taskOrder Integer
showOnMainPage Boolean
createUser String
createDate Instant
modifyUser String
modifyDate Instant
}

@filter
@paginate(pagination)
entity Step {
completed Boolean
notes TextBlob
createUser String
createDate Instant
modifyUser String
modifyDate Instant
}

@filter
@paginate(pagination)
entity Usage {
action String required
parm String
user String maxlength(25) required
dateTime Instant required
}

@filter
@paginate(pagination)
entity ProtectedClass {
code Integer min(0) max(9) required
name String maxlength(128)
description String maxlength(1024)
}

@filter
@paginate(pagination)
entity Derivation {
code String maxlength(10) required
name String maxlength(128)
description String maxlength(1024)
}

@filter
@paginate(pagination)
entity SourceType {
code String maxlength(10) required
name String maxlength(128)
description String maxlength(1024)
}

@filter
@paginate(pagination)
entity EpsilonDataSource {
name String maxlength(128)
}

@filter
@paginate(pagination)
entity Collection {
name String maxlength(250) required
description String maxlength(1024)
global Boolean
shared Boolean
createUser String required
createDate Instant required
modifyUser String
modifyDate Instant
}

@filter
@paginate(pagination)
entity CollectionGroup {
name String maxlength(250) required
description String maxlength(1024)
createUser String required
createDate Instant required
modifyUser String
modifyDate Instant
}

relationship OneToOne {
PlatformDE{platform} to Platform{de}
PlatformInst{platform} to Platform{install}
PlatformList{platform} to Platform{list}
}

relationship ManyToOne {
UPC{attribute required} to Attribute
UPC{category required} to Category
UPC{protectedClass} to ProtectedClass
UPC{epsilonDataSource} to EpsilonDataSource
UPC{royalty} to Royalty
PlatformDE{section} to Section
Platform{release} to Release
Platform{category} to Category{platform}
Platform{platformType} to PlatformType
Product{platformType} to PlatformType
Dimension{universe} to Universe
Step{task} to Task
Collection{owner required} to User with builtInEntity
}

relationship OneToMany {
UPC{rules} to UPCRule{upc required}
UPC{privateNotes} to PrivateNotes{upc required}
UPC{platforms required} to Platform{upc required}
Platform{values required} to FieldValue
Dimension{categories required} to Category
UPC{steps} to Step
Collection{group} to CollectionGroup
}

relationship ManyToMany {
UPC{sourceType} to SourceType{upc}
UPC{derivation} to Derivation{upc}
Platform{product} to Product{platform}
Collection{upc} to UPC /{collection}/
Collection to User with builtInEntity
}

-->
Entity configuration(s) entityName.json files generated in the .jhipster directory
Browsers and Operating System

Windows 11, Edge

  • Checking this box is mandatory (this is just to show you read everything)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions