Last week I was working on the backend of a project(SEF AcadeMiX) which uses JPA and spring boot. There, I had to add translations of the data also into the database. (Actually, we had already created the relevant tables for that in the initial project) There was a separate table for languages and separate tables for translations. I’m sure this is not clear. So here’s a diagram.

Few days before we figured out something which we had missed that is we don’t need a separate table for languages because we hope to use only two languages. So we had a discussion and decided to use Enums for languages.

#hibernate #enum #enumeration #spring-boot #jpa

Enums with JPA and SpringBoot
2.90 GEEK