Uploaded image for project: 'Hibernate OGM'
  1. OGM-1235

Exception when Id generation is used with Table per concrete class strategy

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Planning
    • Component/s: core, documentation
    • Labels:
      None

      Description

      If the following mapping is used:

      @Entity
      @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
      public abstract class BaseEntity {
          protected UUID id;
      
          @Id
          @GeneratedValue(generator = "uuid")
          @GenericGenerator(name = "uuid", strategy = "uuid2")
          public UUID getId() {
              return id;
          }
      ...
      }
      

      The user sees the following exception:

      Caused by: org.hibernate.MappingException: No Dialect mapping for JDBC type: -2
      

      It seems the error is caused by the fact that Hibernate ORM creates an additional table for this mapping containing the ids generated. We should try to solve the issue or improve the error message and update the documentation.

        Attachments

          Issue links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: