Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/perl/10.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中的“has many”属性编制索引_Grails_Indexing_Gorm_Has Many - Fatal编程技术网

为Grails中的“has many”属性编制索引

为Grails中的“has many”属性编制索引,grails,indexing,gorm,has-many,Grails,Indexing,Gorm,Has Many,有可能在hasMany属性上建立索引吗 Class Author(){ static hasMany = [books: Book] static mapping = { books index:'book_id' } } 你可以这样用 Class Author(){ static hasMany = [books: Book] List books // Generates column `book_idx` in table for Book. stati

有可能在hasMany属性上建立索引吗

Class Author(){

 static hasMany = [books: Book]

  static mapping = {
    books index:'book_id'
  }

}
你可以这样用

Class Author(){

 static hasMany = [books: Book]
  List books // Generates column `book_idx` in table for Book.

static mapping = {
      books indexColumn: [name: "book", type: Integer]
    }
}