For my Angular / H2 monolith, jHipster generates the wrong create / update class for my Shipment entity which has a one-to-one relationship with ShoppingOrder. It wants to load a non-existent shopping order instead of loading all orders when creating a new shipment.
Overview of the issue
For my Angular / H2 monolith, jHipster generates the wrong create / update class for my
Shipment
entity which has a one-to-one relationship withShoppingOrder
. It wants to load a non-existent shopping order instead of loading all orders when creating a new shipment.shipment-update.component.ts
which loads the shopping order, starting in line 48.this.editForm.get('orderId').value
isundefined
, but because of the two!
in line 56, theelse
branch kicks in and tries to load the non-existing shopping order then.Here is the stacktrace:
I added log statements in the same Angular class (lines 57 and 60), so you can see in the browser dev tools console how the
else
branch is reached:Motivation for or Use Case
I have a valid JDL file that jHipster imports without reporting an error. However, the generated front-end code doesn't work for one entity.
Reproduce the error
./gradlew
to start the application.Related issues
9990: For that very same entity, JHipster generates the wrong fake data.
Suggest a Fix
In line 56 of
shipment-update.component.ts
, take away one of the two!
in front ofthis.editForm.get('orderId').value
.JHipster Version(s)
JHipster 6.1.2, Java 11
JHipster configuration
JHipster configuration, a
.yo-rc.json
file generated in the root folder.yo-rc.json file
JDL for the Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryJDL entity definitions
Environment and Tools
openjdk version "11.0.3" 2019-04-16 OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.3+7) OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.3+7, mixed mode)
git version 2.22.0
node: v10.15.3
npm: 6.9.0
yeoman: 2.0.6
Docker version 18.09.2, build 6247962
docker-compose version 1.23.2, build 1110ad01
Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryShipment.json
Browsers and Operating System
macOS Mojave 10.14.4, Safari