Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/sorting/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
Sorting Grail域模型关联在多个字段上的默认排序_Sorting_Grails_Default_Gorm - Fatal编程技术网

Sorting Grail域模型关联在多个字段上的默认排序

Sorting Grail域模型关联在多个字段上的默认排序,sorting,grails,default,gorm,Sorting,Grails,Default,Gorm,我四处寻找一个解决方案,对多个领域的领域模型关联进行排序,但没有找到一个答案。 这项功能是否还没有实现?在这种情况下,是否有“良好”的解决方法 我有两种型号: Board{ static hasMany = [tiles: Tile] static mapping = { This is what i would like to do!! sort x : 'asc' sort y : 'acs' } } Tile { int x int y }

我四处寻找一个解决方案,对多个领域的领域模型关联进行排序,但没有找到一个答案。 这项功能是否还没有实现?在这种情况下,是否有“良好”的解决方法

我有两种型号:

Board{
  static hasMany = [tiles: Tile]
  static mapping = {
     This is what i would like to do!!
    sort x : 'asc'
    sort y : 'acs'
  }
} 
Tile {
  int x
  int y
}

我无法确定映射中是否内置了排序。我已经为Grails工作了将近3年,但还没有看到这一点。但我认为更简单的方法是尝试使用集合排序,而Title实现可比性。然后你做一个收集。排序(瓷砖)