Douglas168
Douglas168

Reputation: 17

jhipster import-jdl your-jdl-file.jh

After doing "jhipster import-jdl your-jdl-file.jh" to generate entities, if I found something missing (ie. relationship, entity, or field within an entity), can I redo the jh file and rerun the command again to make the changes? Appreciate the help!

Upvotes: 2

Views: 2686

Answers (2)

Ahmed Hammad
Ahmed Hammad

Reputation: 669

Yes, you can. But you must be carful to:

  1. Your code is in source control
  2. No file is dirty, I mean all are committed
  3. Regenerate and overwrite all files
  4. Review changes carefully file by file to bring back your overwritten changes.
  5. In case of any problem, it is safe to just remove all local changes.

Another approach that I prefer, is to use the command line to do entity changes commands to affect changed entities only. Use

jhipster entity entity-name

It will overwrite affected entity files only, but be carful that, these changes will be outside your JDL file. You still must be carful using source control as described above.

Upvotes: 1

matthieusb
matthieusb

Reputation: 505

It is indeed possible but this might erase some of the custom modifications to the model you've made as it is regenerating them.

That being said, I strongly advise you take a look at the liquibase capabilities offered by Jhipster (For SQL databases). With that, you just have to update your model classes using the right annotations and that will update your database model accordindly (After a few other steps). That can be used for small adjustments when you've already been working on your app, rather that re-generating everyhting, which would seem a bit overkill to me.

If you want the full procedure, take a look at the (well detailed) documentation : https://jhipster.github.io/development/ and go down to Using MySQL, MariaDB or PostgreSQL in development.

Hope this helps !

Upvotes: 0

Related Questions