Uploaded image for project: 'Cayenne'
  1. Cayenne
  2. CAY-1987

Widen types before performing in-memory evaluation of qualifiers using j.l.Number subclasses

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 4.0.M2
    • 4.0.M3
    • Core Library
    • None
    • trunk

    Description

      There is a difference in the behavior of Expressions evaluated in memory versus by the database when comparing attributes with a type like java.lang.Short with a literal of type java.lang.Integer. In memory Short(1) != Integer(1), but they are equal in the database. Using a less strict comparison in memory would be preferable.

      I figured there would be an open source implementation of this somewhere that calculates the widest type and compares the two values, but I couldn't find one. I imagine you could just call number.doubleValue() and compare that, but that seems sketchy.

      If you think this is worth doing I could try writing an implementation.

      Attachments

        Activity

          People

            johnthuss John Huss
            johnthuss John Huss
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: