I am running the latest JHipster generator
izio@1z10:~$ jhipster --version
Using JHipster version installed globally
5.3.4
and I'm using the following JDL by running
jhipster import-jdl jhipster-jdl.jh
to generate my microservices and gateway projects.
application {
config {
baseName Gateway
applicationType gateway
packageName com.app.gateway
databaseType postgresql
devDatabaseType postgresql
prodDatabaseType postgresql
serverPort 8080
languages [en,it,de,fr,es,pt-pt]
serviceDiscoveryType eureka
}
entities *
}
application {
config {
baseName authorMS
applicationType microservice
packageName com.app.ams
databaseType postgresql
devDatabaseType postgresql
prodDatabaseType postgresql
serverPort 8081
serviceDiscoveryType eureka
}
entities Author
}
application {
config {
baseName bookMS
applicationType microservice
packageName com.app.bms
databaseType postgresql
devDatabaseType postgresql
prodDatabaseType postgresql
serverPort 8082
serviceDiscoveryType eureka
}
entities Book
}
entity Author{
Name String required
}
entity Book{
Name String required
}
relationship ManyToMany{
Book{authors(name)} to Author
}
dto * with mapstruct
service * with serviceImpl
paginate * with pagination
microservice Author with authorMS
microservice Book with bookMS
Everything seems to be ok, at least with the generation part, since there is no error with the jhipster import-jdl
command.
The prolem here is that I need a way to link entities by their ID among different microservices.
Right now the link is made wrongly to the other entity class (even if it resides in a different microservice). Obviously this results in an impossible to run app, due to missing entity class.
In such cases the only logical solution would be to link entities among different microservices by using their IDs rather than the entity class.
Is there any way to do this from the JDL, rather than making the required changes by hand?