db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthew T. Adams (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JDO-598) Make SingleFieldIdentity classes implement Comparable
Date Thu, 26 Jun 2008 23:29:45 GMT

    [ https://issues.apache.org/jira/browse/JDO-598?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12608623#action_12608623
] 

Matthew T. Adams commented on JDO-598:
--------------------------------------

Maybe we could support ObjectIdentity with a compareTo method like this:

int compareTo(Object that) {
  if (that instanceof Comparable && this.getKey() instanceof Comparable) { /* cast
both & return comparison */ }
  else {
    return 0; // just return 0 because we don't know
  }
}

Thoughts?

> Make SingleFieldIdentity classes implement Comparable
> -----------------------------------------------------
>
>                 Key: JDO-598
>                 URL: https://issues.apache.org/jira/browse/JDO-598
>             Project: JDO
>          Issue Type: Improvement
>          Components: api2
>            Reporter: Andy Jefferson
>             Fix For: JDO 2 maintenance release 2
>
>         Attachments: SingleFieldIdentity_Comparable.patch
>
>
> Would be preferable for javax.jdo.identity classes to implement Comparable so that we
can store them in a TreeSet etc

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message