Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

columnDefinition = "TEXT" for all types of databases

Tags:

java

jpa

Locally I use mysql, so when I use

 @Column(columnDefinition = "TEXT")

Unfortunately application have to run at different databases too, I've not been told which ones just "at all".

Is it possible to make something with similar effect, but working at most of databases? How can I achieve it?

like image 897
akuzma Avatar asked Feb 28 '13 12:02

akuzma


1 Answers

What about something like this:

@Lob
private String someString;

I think it's more portable and should effectively generate TEXT or LONGTEXT data type.

like image 194
Paweł Wyrwiński Avatar answered Oct 02 '22 13:10

Paweł Wyrwiński