How to escape a column name?
You have two choices:
-
Either you provide the
@Column
annotation to escape theuser
property:@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_identifiers
totrue
:<property name="hibernate.globally_quoted_identifiers" value="true"/>
For more details, check out this article.