jhipster / jhipster-dotnetcore

JHipster.NET blueprint
Apache License 2.0
310 stars 92 forks source link

JHipster .NET Core: Entity regeneration fails after JDL import with --single-entity #1464

Open jfcode27 opened 3 months ago

jfcode27 commented 3 months ago

Overview of the issue

The error "Cannot read properties of undefined (reading 'length')" occurs when regenerating an entity using jhipster-dotnetcore:entity only for entities that have relationships. This happens after importing a JDL file and attempting to regenerate a specific entity with the --single-entity flag.

Motivation for or Use Case

I need to regenerate an entity in my JHipster .NET Core project while maintaining existing entities and introducing modifications from a JDL file.

Reproduce the error

  1. Import a JDL file using: jhipster-dotnetcore import-jdl jdl.jh --json-only
  2. Run the entity regeneration command for a specific entity: jhipster-dotnetcore entity EntityName --single-entity

Expected behavior

The entity should be regenerated using the information from the JDL file, while preserving existing entities and configurations.

JHipster Version(s)

Mandatory Checkbox

image