1

I am using entity sub generator to generate entities in my jhipster gateway app by giving path of microservice app. but looks like I have to run sub generator for every entity in microservice . is there any way that it can read all the .json file and in micro service and generate all the entities ?

Mayurb
  • 577
  • 2
  • 10
  • 21

2 Answers2

3

I personally do as following :

  1. Copy repository ".jhipster" from the microservice repository into the Gateway repository
  2. Generate the gateway with the following command:

    yo jhipster --with-entities

Jack Admin
  • 307
  • 1
  • 13
  • This is good..and works thanks a bunch for the trick. They can might as well add one more option to give path to list of json files of entities , which are generated in microservice app. May be after the question where it asks , which microservice you want to link this gateway to?..or something like do you want to generate the entities too? something like that.. or is it too much to ask :) as they have already done so much :) – Mayurb Aug 21 '17 at 09:43
  • @Mayurb If you type run `jhipster entity EntityName` on the gateway and it doesn't exist in the gateway's .jhipster folder, it will prompt you to enter a path to the microservice. The only downside to this is that you have to generate each entity by itself – Jon Ruddell Aug 21 '17 at 17:54
  • @JonRuddell Exactly!!, that's the reason I asked this question, to see how others are solving this problem of generating each entity by yourself. – Mayurb Aug 21 '17 at 19:22
1

If you create your entities with jdl-studio you can specify microservices for them like in the doc.

microservice * with mysuperjhipsterapp except C
microservice C with myotherjhipsterapp

You can then generate the entitites with jhipster import-jdl my_file.jdl in both the gateway and the microservice.

You can skip entities from the gateway or the microservice by using this options in your jdl file:

skipClient for A
skipServer for B
freemanpolys
  • 1,848
  • 20
  • 19