There is an entity in which one of the fields is enum.

@Entity @Table(name = "PRODUCT") public class Product { @Id @Column(name = "ID") @GeneratedValue(strategy = GenerationType.IDENTITY) private long id; @Column(name = "NAME") private String name; @Column(name = "DESCRIPTION") private String description; @Column(name="CONDITION") @Enumerated(EnumType.STRING) private Condition condition; ... getter-ы - setter-ы, constructor-ы 

enum

 public enum Condition { NEW , USED} 

With enum, no entity is created in the database (MySQL).

  • It is not clear what the glitch was associated with, but the issue was resolved by renaming the class Enum (Conditions). - Eugene Krotov

1 answer 1

Starting with the SQL-92 standard, the word CONDITION is a keyword, i.e. has a specific meaning in the syntax of the language. Therefore, the table cannot have the name CONDITION .

In such cases, shielding is applied using reverse apostrophes (English backticks - ``). That is, your table should be called `CONDITION` . To achieve this, set the table name explicitly via the @Table annotation or for Hibernate 3.5 and higher, enable the hibernate.globally_quoted_identifiers option in the configuration.