Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typo3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Grails ';中基本非域类型的文本字段;有许多';圣杯_Grails_Gorm_Grails 2.0_Grails Plugin - Fatal编程技术网

Grails ';中基本非域类型的文本字段;有许多';圣杯

Grails ';中基本非域类型的文本字段;有许多';圣杯,grails,gorm,grails-2.0,grails-plugin,Grails,Gorm,Grails 2.0,Grails Plugin,域类是: package com.sample class Person { String id String name Integer age Address address static hasMany = [pets:Pet, children : String] static mapWith = "mongo" static constraints = { address nullable:true

域类是:

 package com.sample

 class Person {
   String id
   String name
   Integer age
   Address address
     static hasMany = [pets:Pet, children : String]

     static mapWith = "mongo"
     static constraints = {
            address nullable:true
     }
 }
这是应用程序的创建页面:

有人能告诉我如何为字段“children”(用红色包围)获取文本字段吗
Im使用自动生成的视图

从hasMany约束中删除子项,并将其与其他变量一样放置。然后将gsp文件中的标记从更改为

hasMany用于引用其他表。您确定要将字符串放在那个里吗?那个么我应该如何在Groovy中表示一个列表?假设您有类似于Pet的子对象域。我希望你们可以写类似于Pets的东西。若我并没有一个类似于Pet的域对象,我想实现这个列表呢?创建域对象是唯一的方法吗?