Allow beans to be used as Hibernate naming strategies
See original GitHub issueSpring Boot already contains it’s own SpringNamingStrategy
jpa naming strategy.
In many projects all database objects require to have it’s own prefix like abc_customers
.
It would be nice if Boot’s SpringNamingStrategy
would support setting a prefix e.g. using a property like: spring.jpa.hibernate.naming-strategy.prefix=abc
Issue Analytics
- State:
- Created 9 years ago
- Reactions:1
- Comments:15 (12 by maintainers)
Top Results From Across the Web
Hibernate 5 Naming Strategy Configuration - Baeldung
Hibernate 5 provides two different naming strategies for use with Hibernate entities: an Implicit Naming Strategy and a Physical Naming ...
Read more >Set hibernate naming strategy as Spring bean - Stack Overflow
I want to provide custom NamingStrategy to add prefix to every table managed by hibernate. I found I can use property: spring.jpa.hibernate.
Read more >Naming Strategies in Hibernate 5 - Thorben Janssen
Hibernate's naming strategies define how to get the table and column names for an entity. You can implement your own mapping to fullfil...
Read more >2. JPA Repositories - Spring
3, “Creating repository instances”. Beyond that it activates persistence exception translation for all beans annotated with @Repository to let exceptions being ...
Read more >Chapter 2. Entity Beans
The default EJB3 naming strategy use the physical column name as the logical ... Hibernate Annotations allows you to use association annotations in...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Rather than offering a configuration property that can be used to apply a table name prefix, and only when you’re using Boot’s default naming strategies, I’d prefer a more general purpose solution.
This branch contains a proposal that allows the user to provide
ImplicitNamingStrategy
andPhysicalNamingStrategy
beans that are automatically applied to Hibernate by Boot’s auto-configuration. In addition to providing more flexibility than a table name prefix property, using beans means that the naming strategies can be auto-configured by a library and can be customised or back-off as is appropriate for that library’s needs.And before doing that, please take a moment to read the relevant section of the documentation.