Hibernate 5.0.12 Wrong column definition escape with Mysql 5.7

Viewed 1852

I'm using Hibernate + Spring JPA and Mysql 5.7 as DBMS. I want to use some reserved keywords as column name and for that I eanbled:

spring.jpa.properties.hibernate.globally_quoted_identifiers=true

Some columns have a custom definition like:

@CreatedDate
    @Column(updatable = false, columnDefinition = "DATETIME(6)")
    private LocalDateTime createdDate;

Unfortunately Hibernate translate this as:

`created_date` `DATETIME(6)`

instead of

`created_date` DATETIME(6)

I opened an issue on Hibernate JIRA (JIRA); I was wondering if there is a workaround to use meanwhile.

3 Answers

i found a solution for u just @Column(name = ""to"") what ever u want repplace instead of to

Related