| Hello, we have some projects created with Hibernate 4. At moving them to Hibernate 5.2.1 we run into a problem with Mysql databases: When the @Table name of an Entity is set to a quoted String like in the following example, the table can be created with hibernate. But when"javax.persistence.schema-generation.database.action" or "hibernate.hbm2ddl.auto" is set to "validate", it doesn't know the table any more. Entity:
@Entity
@Table(name = "`Language`")
public class Language {
private int id;
private String description;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
public int getId() {
return id;
}
...
}
The database table for this entity is created at first application start with hibernate's schema generation without problems:
After switching this property to
now the schema validation doesn't find this table any more:
...
Caused by: org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: missing table [`Language`]
at org.hibernate.tool.schema.internal.SchemaValidatorImpl.validateTable(SchemaValidatorImpl.java:130)
at org.hibernate.tool.schema.internal.SchemaValidatorImpl.performValidation(SchemaValidatorImpl.java:100)
at org.hibernate.tool.schema.internal.SchemaValidatorImpl.doValidation(SchemaValidatorImpl.java:67)
...
With Hibernate 4.3, validation works for such entities. |