-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Minor - P4
-
4
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Hibernate has three ways to specify some entity's id column name:
- JPA `@Column` annotation's column property
- legacy hbm xml files
- JPA orm xml files
We need to differentiate between whether id column name is specified as above or not. If so we need to throw exception if the explicit id column is not `_id`.
One possible implementation is to tap into Hibernate's `ImplicitNamingStrategy` (https://docs.jboss.org/hibernate/orm/6.6/userguide/html_single/Hibernate_User_Guide.html#naming) to collect all the implicit id column implicit names (by its `
determineIdentifierColumnName()` method)
.
The complexity is it requires service loader injection and difficult to verify by integration testing.
- is related to
-
HIBERNATE-25 hardcode _id as collection primary key field name
-
- Closed
-