How to escape a column name?
You have two choices:
-
Either you provide the
@Columnannotation to escape theuserproperty:@Entity public class Services { @Id private Long id; private String name; private String host; private Short port; @Column(name="\"user\"") private Sring user; private String password; } -
Or, you can set the
hibernate.globally_quoted_identifierstotrue:<property name="hibernate.globally_quoted_identifiers" value="true"/>
For more details, check out this article.