Skip to content

Jhipster not generating entities #29445

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ken4ward opened this issue May 9, 2025 · 1 comment
Open

Jhipster not generating entities #29445

ken4ward opened this issue May 9, 2025 · 1 comment

Comments

@ken4ward
Copy link

ken4ward commented May 9, 2025

Issue Report: Entities Not Created from JDL File

Overview of the issue

The JHipster JDL file defines multiple applications and entities, but the entities are not being created as expected. No error is thrown, but the omission of entity creation is problematic.

JHipster JDL

JDL definitions
application {
  config {
    baseName gateway
    packageName com.christdoes.gateway
    applicationType gateway
    authenticationType oauth2
    blueprints []
    buildTool maven
    cacheProvider hazelcast
    databaseType sql
    devDatabaseType postgresql
    enableHibernateCache true
    enableSwaggerCodegen true
    enableTranslation true
    languages [en, fr, nl]
    messageBroker kafka
    nativeLanguage en
    prodDatabaseType postgresql
    reactive true
    searchEngine elasticsearch
    serverPort 8081
    serviceDiscoveryType consul
    skipServer false
    skipUserManagement false
    testFrameworks [cypress, cucumber, gatling]
    websocket false
    clientFramework react
    clientTheme cerulean
    clientThemeVariant primary
    skipClient false
  }
  entities *
  use mapstruct, serviceImpl, serviceClass, pagination for all
}

application {
  config {
    baseName additionaluserinfo
    packageName com.christdoes.additionaluserinfo
    applicationType microservice
    authenticationType oauth2
    blueprints []
    buildTool maven
    cacheProvider hazelcast
    databaseType sql
    devDatabaseType postgresql
    enableHibernateCache true
    enableSwaggerCodegen true
    enableTranslation true
    languages [en, fr, nl]
    messageBroker kafka
    nativeLanguage en
    prodDatabaseType postgresql
    reactive true
    searchEngine elasticsearch
    serverPort 8087
    serviceDiscoveryType consul
    skipServer false
    skipUserManagement true
    testFrameworks [cypress, gatling]
    websocket false
  }
  entities AdditionalUserInfo, PhoneNumber, Address
  use mapstruct, serviceImpl, serviceClass, pagination for all
}

// ------------------------------
// USER DETAILS ENUMS
// ------------------------------
enum Gender {
  MALE,
  FEMALE,
  OTHER
}

enum PhoneType {
  MOBILE,
  HOME,
  WORK,
  OTHER
}

enum AddressType {
  HOME,
  WORK,
  TEMPORARY,
  OTHER
}

enum PhoneVerification {
  UNVERIFIED,
  PENDING,
  VERIFIED,
  FAILED,
  EXPIRED
}

// ------------------------------
// USER DETAILS RELATIONSHIPS
// ------------------------------
relationship ManyToOne {
  PhoneNumber{phonenumber(phone) required} to AdditionalUserInfo
  Address{userAddress(address) required} to AdditionalUserInfo
}

relationship ManyToOne {
  AdditionalUserInfo{user(login) required} to User with builtInEntity
}

// ------------------------------
// USER DETAILS ENTITIES
// ------------------------------
entity AdditionalUserInfo {
  id UUID,
  gender Gender required,
  phone String pattern(/^

\[+]

\[0-9]{10,15}\$/) minlength(10) maxlength(16),
  address String,
  country String,
  createdDate Instant required,
  lastModifiedDate Instant required,
  lastModifiedBy String required
}

entity PhoneNumber {
  id UUID,
  number String required pattern(/^

\[+]

\[0-9]{10,15}\$/) minlength(10) maxlength(16),
  type PhoneType required,
  verified PhoneVerification
  isVerifiedPhoneNumber Boolean required,
  isPrimary Boolean required,
  createdAt Instant required,
  updatedAt Instant required
}

entity Address {
  id UUID,
  street String required,
  city String required,
  state String,
  postalCode String,
  country String required,
  type AddressType required,
  isPrimary Boolean required,
  startDate LocalDate required,
  endDate LocalDate,
  createdAt Instant required,
  updatedAt Instant required
}

microservice AdditionalUserInfo, PhoneNumber, Address with updatedusermodel

Motivation for or Use Case
The expected behavior is that all entities defined in the JDL file should be created. However, the entities are missing, which affects the functionality of the generated applications.

Reproduce the error

  1. Generate the application using the provided JDL file.
  2. Check the generated entities.
  3. Observe that the entities are missing despite being defined in the JDL file.

Related issues
Please check if similar issues have been reported before.

Suggest a Fix

  1. Possible areas to investigate:
  2. Ensure that the jhipster jdl command is correctly parsing the entities.
  3. Verify if there are any constraints in the blueprint or configuration that might be preventing entity creation.
  4. Check if the updatedusermodel microservice configuration is affecting entity generation.

JHipster Version(s)
sh
jhipster --version
8.11.0
Browsers and Operating System
sh
MacOS Sequoia 15.1 (not browser-related)

Copy link
Contributor

github-actions bot commented May 9, 2025

Issue check: JHipster has completed the sample check

29445 Value
Entities JDL -
--- ---
Application Generation ✔️
Check Status
Frontend check
Backend check
E2E check

This check uses jhipster info or jdl output from the issue description to generate the sample.
Bug report that does not contain this information will be marked as invalid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants