jhipster / generator-jhipster

JHipster is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures.
https://www.jhipster.tech
Apache License 2.0
21.54k stars 4.02k forks source link

Presence of the entitySuffix pragma in JDL results in compilation error #24173

Closed user-0209 closed 11 months ago

user-0209 commented 11 months ago
.yo-rc.json file
{
  "generator-jhipster": {
    "applicationIndex": 0,
    "applicationType": "monolith",
    "authenticationType": "jwt",
    "baseName": "jhnew",
    "buildTool": "maven",
    "cacheProvider": "ehcache",
    "clientFramework": "angular",
    "clientPackageManager": "npm",
    "databaseType": "sql",
    "devDatabaseType": "h2Disk",
    "devServerPort": 4200,
    "dtoSuffix": "DTO",
    "enableHibernateCache": true,
    "enableSwaggerCodegen": true,
    "enableTranslation": true,
    "entities": [
      "ApplicationUser"
    ],
    "entitySuffix": false,
    "jhiPrefix": "jhi",
    "jhipsterVersion": "8.0.0",
    "languages": [
      "en",
      "de"
    ],
    "lastLiquibaseTimestamp": 1699580540000,
    "messageBroker": "no",
    "nativeLanguage": "en",
    "packageFolder": "com/othersystem/sample",
    "packageName": "com.othersystem.sample",
    "prodDatabaseType": "mariadb",
    "reactive": false,
    "searchEngine": "elasticsearch",
    "serverPort": "8080",
    "serviceDiscoveryType": "no",
    "skipUserManagement": false,
    "testFrameworks": [
      "gatling",
      "cucumber"
    ],
    "websocket": "spring-websocket",
    "withAdminUi": true
  }
}
Environment and Tools

openjdk version "17.0.8.1" 2023-08-24 OpenJDK Runtime Environment (build 17.0.8.1+1-Ubuntu-0ubuntu122.04) OpenJDK 64-Bit Server VM (build 17.0.8.1+1-Ubuntu-0ubuntu122.04, mixed mode, sharing)

git version 2.34.1

node: v20.9.0 npm: 10.1.0

Docker version 24.0.7, build afdd53b

JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory
JDL entity definitions
entity ApplicationUser {
  additionalField Integer min(42) max(42)
}
relationship OneToOne {
  ApplicationUser{appuser(login) required} to User with builtInEntity
}

dto ApplicationUser with mapstruct
paginate ApplicationUser with pagination
service ApplicationUser with serviceImpl
search ApplicationUser with elasticsearch
filter ApplicationUser

Overview of the issue

When generating and building the application (using JDL below) the presence of the entitySuffix pragma makes the compilation fail with:

src/main/java/com/othersystem/sample/repository/search/ApplicationUserSearchRepository.java:[38,19] cannot find symbol
  symbol:   class ApplicationUserRepository
  location: class com.othersystem.sample.repository.search.ApplicationUserSearchRepositoryInternalImpl

Tried this with entitySuffix false and with entitySuffix anysuffix. Removing the pragma makes the compilation pass.

Motivation for or Use Case

jhipster export-jdl produce a JDL file with the pragma set to false. Using just this JDL doesn't allow to reproduce the application.

Reproduce the error

With the JDL given below:

Related issues
Suggest a Fix

Don't have a fix. But removing the pragma alltogether avoids the problem.

JHipster Version(s)

jhipster 8.0.0

JHipster configuration
JDL definitions
application {
  config {
//  jhipsterVersion "8.0.0"

    baseName jhnew
    applicationType monolith

    packageName com.othersystem.sample

    databaseType sql
    devDatabaseType h2Disk
    prodDatabaseType mariadb

    authenticationType jwt

    serverPort 8080

    searchEngine elasticsearch

    cacheProvider ehcache
    enableHibernateCache true               // default
    websocket spring-websocket
    messageBroker no                        // default
    serviceDiscoveryType no                 // default

    jhiPrefix jhi                           // default
    entitySuffix false                      // results in: cannot find symbol: 
//                                          //             class ApplicationUserRepository
    dtoSuffix DTO                           // default

    clientPackageManager npm                // default
    clientFramework angularX

    enableTranslation true                  // default
    nativeLanguage en
    languages [en, de]

    skipUserManagement false                // default

    buildTool maven                         // default
    enableSwaggerCodegen true

    testFrameworks [gatling, cucumber]

    reactive false                          // default
    withAdminUi true
  }

  entities *
}

entity ApplicationUser {
  additionalField Integer min(42) max(42)
}

relationship OneToOne {
  ApplicationUser{appuser(login) required} to User with builtInEntity
}

service  all with serviceImpl
dto      all with mapstruct
paginate all with pagination
filter   all
search   all with elasticsearch
  
Entity configuration(s) entityName.json files generated in the .jhipster directory
Browsers and Operating System
github-actions[bot] commented 11 months ago

JHipster has completed the sample check .yo-rc.json: valid Entities JDL: valid Application: successfully generated Frontend check: success Backend check: failure E2E check: skipped