0

我有一个域类,其中包含一个字符串列表作为众多属性之一。有时,列表中的字符串超过 255 个字符。那么,我怎样才能在数据库中增加这个限制呢?或者更改 CLOB 或 TEXT 类型的列类型?

4

1 回答 1

1

If I understood you correctly, you want to change the type o the column in the join table of your domain class. You can do this in the mapping of your hasMany, through the type option.

class Person {
  static hasMany = [nicknames: String]
  static mapping = { 
    hasMany joinTable: [
      name: 'bunch_o_nicknames', 
      key: 'person_id', 
      column: 'nickname', 
      type: "text"
    ]
  } 
}
于 2013-03-31T23:03:32.357 回答