2

How can I declare within an Entity Bean a Long Text attribute? For example: String description I would like it to be more than 255 varchar, and maybe mapped on MySQL as TEXT.

Thanks

Solved: JPA: how do I persist a String into a database field, type MYSQL Text Using @Lob annotation

Community
  • 1
  • 1
Mauro
  • 361
  • 1
  • 4
  • 14

1 Answers1

0

Just define the corresponding column in database as TEXT, and JPA should happily map the column to your attribute.

JB Nizet
  • 678,734
  • 91
  • 1,224
  • 1,255
  • That means that for each deploy I have to "manually" edit the database schema on mysql? – Mauro May 25 '11 at 11:03
  • Do you mean that you generate your database schema entirely from your JPA entities mapping? If that's the case, then it would be useful to tell which tool you're using to generate the schema, because that's not part of the standard. – JB Nizet May 25 '11 at 11:10