Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using VARCHAR or TEXT as default String mapping in OpenJPA

By default, OpenJPA's postgres dictionary generates VARCHAR(255) for String fields without stated length. Can it be set up to generate VARCHAR or TEXT instead for all such fields, so that I don't need to repeat @Column(columnDefinition = "TEXT") everywhere? Of course, if the length is given explicitly, e.g. @Column(length = 128), the result should be VARCHAR(128). For that matter, do any other JPA providers allow this?

like image 837
Alexey Romanov Avatar asked Jun 08 '12 14:06

Alexey Romanov


1 Answers

It seems that Hibernate supports this since 3.6: 6.5. Type Registry. Tracked by this JIRA issue: HHH-5138.

like image 87
Art Licis Avatar answered Sep 20 '22 23:09

Art Licis