Sankozi
Sankozi

Reputation: 578

Is there a way to define default columnDefinition for a JPA AttributeConverter?

I have custom AttributeConverter that converts CHAR(18) column into some type.

Each time I use this type in some Entity I must add @Column(columnDefinition = "CHAR(18)") to satisfy schema validation in Hibernate. Is there a way to have default columnDefinition so I could skip repeating this?

Upvotes: 1

Views: 29

Answers (1)

talex
talex

Reputation: 20544

You may implement UserType. Here is details.

Upvotes: 0

Related Questions