Grails

== uses compareTo when domain objects implement Comparable for SortedSet

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Won't Fix
  • Affects Version/s: None
  • Fix Version/s: 1.0.2
  • Component/s: None
  • Labels:
    None
  • Environment:
    mac 10.5.2, java 1.5.0_13, grails 1.0

Description

I have a setup similar to as follows:

TopLevelDomainClass
{
SortedSet subLevels
static hasMany= [subLevels:SubLevelDomainClass]
}

SubLevelDomainClass implements Comparable
{
int number
int compareTo(obj)

{ return this.number - obj.number }

}

In a gsp or script, sublevel1==sublevel2 calls the compareTo function for evaluation

Activity

Hide
Graeme Rocher added a comment -

This is the default behaviour of Groovy and has nothing to do with Grails itself, I recommend you raise a question on the Groovy list on how to deal with this

Show
Graeme Rocher added a comment - This is the default behaviour of Groovy and has nothing to do with Grails itself, I recommend you raise a question on the Groovy list on how to deal with this

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: