|
Sadly this is something that the JPA spec requires.
JPA 2.1, Section 2.13 Naming of Database Objects
The following annotations contain elements whose values correspond to names of database identifiers and for which the above rules apply, including when their use is nested within that of other annotations: ... Column (name, columnDefinition, table elements) DiscriminatorColumn (name, columnDefinition elements) ...
That's just a small snippet of the quite long list. But as you can see, JPA requires that the columnDefinition be quoted if <delimited-identifiers/> (one source of hibernate.globally_quoted_identifiers) is enabled. I utterly agree with you that quoting columnDefinition, specifically, is generally silly; but we do need to be compliant. So there is nothing we can do here and remain spec compliant.
Well we could define another setting to allow specifying that hibernate.globally_quoted_identifiers should not affect certain things (like columnDefinition). But either way, this is a feature/enhancement request imo.
As a workaround, with 5.0, you could try the (still experimental) "auto keyword quoting" feature.
|