Hibernate: create a table with lowercase names

Hibernate: I want hibernate to automatically generate my tables with lowercase names.

For example, if my class is called com.myapp.domain.Customer, hibernate will generate a table called Customer. I want to be called a customer. I know that I can use the @Table annotation to specify the table name for each class. But I want this to happen "automatically."

+4
source share
1 answer

Does this work NamingStrategy ?

You would get the name of the managed entity (i.e., the Client) and you must determine the name of the table to use ( entityName.toLowerCase() in your case).

One thing I'm not sure is if NamingStrategies are taken into account when creating tables (hbm2ddl).

+7
source

All Articles