I have to store long strings in MySQL database using spring roo. I assumed that “field string” command generates field with size 255 which is too small. I prefer to not use blob. What should I do?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you create the field using a command like
field string --fieldName field1 --sizeMax 500then Roo will annotate the field with@Size(max = 500)and it works for me if I let Hibernate to create the database schema.(–sizeMax is an optional parameter, you can display all optional parameters after you defined all mandatory ones with — and hitting TAB)
Another solution is to add manually the JPA annotation on the field:
@Column(length=500).Or if you don’t generate the database schema but create it by hand then you can define your column as you like.