Spring roo - adding CLOB field

烈酒焚心 提交于 2019-12-08 06:24:03

问题


In my web application, I am saving some Text message in a COLUMN of a DB table(Oracle). Earlier the VARCHAR2 length(maximum length) is (500 BYTE). Now the maximum length is increased to 4000 characters. So I need to add a 'CLOB' field in my domain class.
Can anyone please clarify what are the steps need to be followed in order to create a CLOB field in my domain class. I also have CLOB cloumn in my DB. (What is the command/syntax to start with?)


回答1:


Adding CLOB at database

and adding the below code in the domain class is the solution.

@Lob
private String message;



回答2:


If you need to create a CLOB field named message then you would run the following command on the Roo Shell:

field string --fieldName message --lob true


来源:https://stackoverflow.com/questions/12566920/spring-roo-adding-clob-field

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!