Detailed explanation of Hibernate naming strategy
The naming strategy of Hibernate can reduce the maintenance of database identifier naming and further reduce the amount of repetitive code in this part of naming, so as to improve the maintenance.
There are two types of naming methods for Hibernate: explicit naming and implicit naming.
1) Explicit naming: when mapping configuration, the database table name and column name set are explicit naming.
2) Implicit naming: explicit naming is generally not necessary, so you can choose to leave it to hibernate for implicit naming when the name is not set. In addition, implicit naming also includes database identifiers that cannot be explicitly named. The interface implicitnaming strategy is used to implement implicit naming.
3) Filter naming: the interface physicalnaming strategy is used to further filter explicit naming or implicit naming.
Example:
TestTable1Impl. java
TestTable2Impl. java
MyImplicitNamingStrategyImpl. java
MyPhysicalNamingStrategyImpl. java
TableNamingConfig. java
spring. xml
Test. java
The above is the whole content of this article. I hope the content of this article can bring some help to your study or work. At the same time, I also hope to support a lot of programming tips!