Back to journal
java MAY 23 · 2020

How to generate a UUID column with JDL and JHipster

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.

Follow Brian Porter on LinkedIn →
← Previous Next →
Brian Porter

Written by

poornerd

CTO at an automotive data company in Munich. Co-founder of SiteForce AG. Four decades writing software and shipping production systems.

Keep reading

Related essays