lundi 23 avril 2018

Hibernate + MySQL - How can I get not guessable generated ID?

How can I get entity ID (primary key) to be hard to guess?

Ideal would be 8 or 16 digit random unique number or String.

I tried UUID but it fails with my H2 tests because of reported bug (https://github.com/h2database/h2database/issues/345).

Or if it's hard with ID... how can I get another column to be auto generated with random unique number while creating ?

I need random, hard to guess, unique ID per user for external API.

Thanks for any suggestions. :)




Aucun commentaire:

Enregistrer un commentaire