Longtext MYSQL Persistence Variable Type

Asked

Viewed 294 times

0

Good morning,

In my database Mysql, I have a column of the type longText.

My doubt is how to declare the type and annotation of this variable in the java class. Soon search found the following information:

@Blob
private String meuCampo;

this proceeds?

Grateful!

  • Now I’m curious, Longtext, have I always used @Lob in mysql if I can test other possibilities? And post the Results;

  • OK Thank you, I am implementing, soon I inform you

  • Hello, it only worked with the jpa1.0 setting

  • Then I’ll remove the rest;

1 answer

0


//Definição JPA 1.0.
@Lob
// Por padrão o tamanho do Text é limitado 65535 bytes.
@Column(name="campo", length=2147483647) 
// No seu caso é LongText 2147483647 bytes.
private String meuCampo;

Browser other questions tagged

You are not signed in. Login or sign up in order to post.