"SchemaManagementException: Schema-validation: missing column [DTYPE] in table [...]" in Hibernate

Solution Verified - Updated -

Issue

  • An entity hierarchy is defined using SINGLE_TABLE inheritance1
  • No DiscriminatorColumn was specified for the root entity
  • At runtime, an exception is raised while validating a pre-existing database schema

    ... org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: missing column [DTYPE] in table [MYSCHEMA.SOMEENTITY]
            at org.hibernate.tool.schema.internal.AbstractSchemaValidator.validateTable(AbstractSchemaValidator.java:136)
            at org.hibernate.tool.schema.internal.GroupedSchemaValidatorImpl.validateTables(GroupedSchemaValidatorImpl.java:42)
            at org.hibernate.tool.schema.internal.AbstractSchemaValidator.performValidation(AbstractSchemaValidator.java:89)
            at org.hibernate.tool.schema.internal.AbstractSchemaValidator.doValidation(AbstractSchemaValidator.java:68)
            at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:191)
            at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:72)
            at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:310)
            at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:467)
            at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:939)
    

  1. This is the default if no strategy is explicitly specified. 

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP) 7
  • Hibernate 5

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In