EJB3NamingStrategy vs ImprovedNamingStrategy Foreign Key Identification

My sleep naming strategy was standard: EJB3NamingStrategy. So, the names of the fields and tables were in camelcase. I switched it to ImprovedNamingStrategy to have a snakecase.

But my foreign keys do not include the primary key name of the referenced object in the name.

Example:

table1: I would name

With the EJB3NamingStrategy, the table2 fields will be:

table2: I would have table1_id

but with ImprovedNamingStrategy the fields of table2 would be: Table 2: I would have table1

Is there a way to have _id with ImprovedNamingStrategy. I don’t understand why sleep mode behaves differently because the logicCollectionColumnName method is identical in both strategies.

+5
source share
2

NamingStrategy , , ImprovedNamingStrategy , , .

+4

spring boot 1.2.7.RELEASE. jpa hibernate. :

package org.springframework.boot.orm.jpa.hibernate;

public class SpringNamingStrategy extends ImprovedNamingStrategy {}
+3

All Articles