throw exception when id column name is specified explicitly and different from _id

XMLWordPrintableJSON

    • 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.

       

       

            Assignee:
            Unassigned
            Reporter:
            Nathan Xu (Inactive)
            None
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: