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

EntityProperty.inId(..) / ninId(..) - disambiguate method parameters

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 4.2
    • 5.0-M1
    • None
    • None

    Description

      EntityProperty has a few polymorphic methods to bind "in" and "nin" ID arrays. E.g. for "in":

      Expression inId(Collection<Object> ids)
      Expression inId(Object firstId, Object... moreIds)
      

      This API has a few issues - parameter ambiguity (e.g. code trying to bind IDs as a "Set<String>" would hit the second (vararg) method instead of the desired first method), and inability to bind an Object[].

      We need to redesign this API to address the two problems above (with deprecation where possible)... Maybe smth like this:

      Expression idsIn(Object... ids)
      Expression idsInCollection(Collection<?> ids)
      

      Other candidates for similar redesign:

      EntityProperty.ninId(..)
      CollectionProperty.contains(..)
      CollectionProperty.containsId(..)
      CollectionProperty.notContains(..)
      CollectionProperty.notContainsId(..)
      MapProperty.contains(..)
      MapProperty.containsId(..)
      MapProperty.notContains(..)
      MapProperty.notContainsId(..)
      
      SelectById.query(..)
      SelectById.dataRowQuery(..)
      

      Attachments

        Activity

          People

            ntimofeev Nikita Timofeev
            andrus Andrus Adamchik
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 10m
                10m