Grails中的SortedSet不起作用

dea*_*mon -2 java grails groovy comparable sortedset

我想使用SortedSetGrails,但我得到的只是一个MissingMethodException.

包含有序集的类如下所示:

class SystemUser {

    SortedSet organisations
    // ... some other fields

    static hasMany = [organisations: Organisation]
    static belongsTo = [Organisation]

}
Run Code Online (Sandbox Code Playgroud)

......以及Comparable像这样实现的类:

class Organisation implements Comparable {

    String name
    // ... some other fields

    static hasMany = [users: SystemUser]

    int compareTo(other) {
        return name.comparteTo(other.name)
    }

}
Run Code Online (Sandbox Code Playgroud)

当我尝试保存SystemUser对象时,我收到此异常消息:

groovy.lang.MissingMethodException: No signature of method: java.lang.String.comparteTo() is applicable for argument types: (java.lang.String) values: [ABC]
Possible solutions: compareTo(java.lang.String), compareTo(java.lang.Object)
Run Code Online (Sandbox Code Playgroud)

我的例子几乎与官方参考例子相同.

Mic*_*rdt 5

没有方法签名:java.lang.String.comparteTo()适用于参数类型

现在看到问题?