generator-jhipster: unable to import-jdl for gateways with no sql

Overview of the issue

Since 4.0.3 it’s able to generate UAA based gateways without database. It’s still needed to add microservice entities using JDL. But this fails, as import-jdl assumes a app must have a database.

The error message is

The jdl is being parsed.
{ name: 'IllegalArgumentException',
  message: 'The passed database type must either be \'sql\', \'mysql\', \'mariadb\', \'postgresql\', \'oracle\', \'mssql\', \'mongodb\', or \'cassandra\'',
  prototype: 
   Error
       at new buildException (/home/david/Projekte/microXchng/code/uaa-setup/gw403/node_modules/jhipster-core/lib/exceptions/exception_factory.js:43:25)
       at Object.getIsType (/home/david/Projekte/microXchng/code/uaa-setup/gw403/node_modules/jhipster-core/lib/core/jhipster/field_types.js:148:11)
       at init (/home/david/Projekte/microXchng/code/uaa-setup/gw403/node_modules/jhipster-core/lib/parser/jdl_parser.js:49:23)
       at Object.parse [as convertToJDL] (/home/david/Projekte/microXchng/code/uaa-setup/gw403/node_modules/jhipster-core/lib/parser/jdl_parser.js:38:3)
       at constructor.parseJDL (/home/david/Projekte/microXchng/code/uaa-setup/gw403/node_modules/generator-jhipster/generators/import-jdl/index.js:49:41)
       at Object.<anonymous> (/home/david/Projekte/microXchng/code/uaa-setup/gw403/node_modules/yeoman-generator/lib/base.js:439:23)
       at /home/david/Projekte/microXchng/code/uaa-setup/gw403/node_modules/yeoman-generator/node_modules/run-async/index.js:25:25
       at /home/david/Projekte/microXchng/code/uaa-setup/gw403/node_modules/yeoman-generator/node_modules/run-async/index.js:24:19
       at /home/david/Projekte/microXchng/code/uaa-setup/gw403/node_modules/yeoman-generator/lib/base.js:440:9
       at runCallback (timers.js:649:20) }
Motivation for or Use Case

Need to generate frontend client for entities

Reproduce the error

Try to import a JDL file using yo jhipster:import-jdl

Related issues

allow uaa gateways to have no database configured

Suggest a Fix

I’m sure this has to be done on jhipster/jhipster-core. In particular we should assert the situation, that for gateways (with uaa) all entities must be mapped to a microservice.

JHipster Version(s)

4.0.3

JHipster configuration

UAA gateway with no Database configured

  • Checking this box is mandatory (this is just to show you read everything)

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 29 (29 by maintainers)

Commits related to this issue

Most upvoted comments

The front-end should only use the REST endpoints underneath, and not be tied to a specific database (this is not totally true: we don’t have the same pagination option for Cassandra). @MathieuAA I’m not sure which solution you find is the “best”, but I would just remove the validation.

@deepu105 Your solution is the best one. I’ll implement it and then add it to the documentation.