简体   繁体   English

Grails域类

[英]Grails domain class

I have defined the following domain class: 我定义了以下域类:

class Content {

  Map i18nDescription = [:]
  ...

}

If run the following code 如果运行以下代码

content.i18nDescription['it'] = "desc desc...."
content.save()

I get the following error: 我收到以下错误:

util.JDBCExceptionReporter ERROR: value too long for type character varying(255)

(I'm using postgres as database) (我正在使用postgres作为数据库)

How can I increase the size of the field i18nDescription['it'] in the database using 如何使用以下方法增加数据库中i18nDescription['it']字段的大小

static constraints = {}

thanks 谢谢

static mapping = {
        title i18nDescription: "text"
    }

That will create a text field. 这将创建一个文本字段。 Which has more than 4000 characters. 其中有4000多个字符。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM