Please consider passing the info about the current entity when calling ImplicitBasicColumnNameSource.determineBasicColumnName and PhysicalNamingStrategy.toPhysicalColumnName The reason is described here: https://stackoverflow.com/questions/75816005/choice-based-on-current-entity-in-implicitnamingstrategy-determinebasiccolumnnam
I know a logical schema of a 3rd-party readonly DB and I want to access it with Hibernate 6. I used the schema to generate `@Entity` beans for it, but there's one problem:
Different entities may have identical logical attribute names, but the physical column names are mapped in a special registry table in the same DB and they may differ among entities and even for the same entity in different environments. For instance, on one environment the column is called "name" and on another it's "name2".
To solve this I'm trying to implement one of these two methods:
- `org.hibernate.boot.model.naming.ImplicitNamingStrategy.determineBasicColumnName(ImplicitBasicColumnNameSource)`
- `org.hibernate.boot.model.naming.PhysicalNamingStrategy.toPhysicalColumnName(Identifier, JdbcEnvironment)`
They are supposed to access the registry table and convert the property accordingly.
However, the caller does not pass the current entity name to the callbacks and I don't know for which entity to retrieve the physical column name!
Is there a workaround better than prefixing all like this? `@Column("MyEntiy$MyProperty")`
See also https://stackoverflow.com/questions/22639588/hibernate-naming-strategy-per-entity https://stackoverflow.com/questions/10877626/hibernate-column-names-based-on-table-name |