How to generate a UUID column with JDL and JHipster

Posted by Brian Porter on May 23, 2020

Not satisified with the standard autoincrement implementation of the default ID columns with the JHipster generator, I did some digging to see what was possible.

I got a tip in the JHipster issues comments on Github, that I could create my own column (not named ID) with the UUID type. This is what I was trying for the ID : id UUID

JHipster JDL UUID

Unfortunatly it seems that Julien Dubois (one of the primary JHipster contributors) is against having ID columns be UUID’s (or strings/varchar/blobs) because of performance and efficiency reasons, so all feature requests in this direction have been closed.

So instead the recommendation was to leave the id and create an additional uuid column (with the type UUID). While this might work in some cases, I really want the UUID to be the primary key.

I still have a few more tips to try, like:

I’ll report back if I discover more. In the mean time you can at least used the UUID column.

If you made it this far, you may as well follow me on LinkedIn: Follow Brian Porter