I just encountered an issue with my PostgreSQL database (and probably others as well) and JPA/Spring: in my application, I have an entity class called User
that shall map to a table with the same name. Creation of the table by JPA fails, because user
is a keyword in PG.
That makes a lot of sense to me and though the internet tells me to quote the table name, that feels kinda cheated. I could go the easy way and use the plural, but all my other tables are in singular. As I can't decide which one's better (I prefer singular, just as the class name), I've gone for prefixing all my tables with T_
, which is not ideal, but satisfies my requirement for an aesthetic database design, if you now what I mean