Uploaded image for project: 'Torque'
  1. Torque
  2. TORQUE-160

Criteria should not inherit from hashtable

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 4.0-beta1
    • None
    • None

    Description

      The reasons for suggesting this are:

      • Criteria is not a logical specialisation of a Hash map.
      • To retain current signatures and comply with java5 generics, Criteria would have to be declared as HashMap<String, Object>, while technically it is a HashMap<String, Criteria.Criterion>
      • the current "put" method does not follow the contract of a Map's put method:
        Criteria.put() returns the Criteria itself, whereas Map.put() returns the value which previously had the passed key.
        Also, if you put() an object into a criteria and then get() the same key, you do not receive the object you put() but a Criteria.Criterion containing the object you put in. This is also not the behaviour expected by a map.

      Attachments

        Activity

          People

            tfischer Thomas Fox
            tfischer Thomas Fox
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: