3 Replies Latest reply on Feb 14, 2011 1:50 PM by rhauch

    Reference and hashCode() method


      Hi all,


      since JCR handles the MULTIPLE node propries as an array of Value an application has to hande the uniqueness of the values by itself. E.g. throgh Set. But org.modeshape.graph.property.Reference does not implement hashCode() method.

      Does anybody have any other ideas how to handle the value's uniqueness in a MULTIPLE node property?

        • 1. Reference and hashCode() method

          But with JCR, wouldn't the application just compare the Value objects to guarantee uniqueness? ModeShape properly implements Value.hashCode() and Value.equals() to reflect value equality. Does that not work correctly?


          Don't confuse the graph-layer classes with those classes that implement the JCR API. The graph-layer is the lower-level functionality that does not have the same semantics as JCR, while the JCR implementation layer enforces the JCR semantics on top of the (more generic) graph layer.

          • 2. Reference and hashCode() method

            Ah, I see what you're saying. Value.hashCode() delegates to the graph-level object value. And that means the Value.hashCode() doesn't work properly. Please log a defect and we'll fix that.

            1 of 1 people found this helpful
            • 3. Reference and hashCode() method

              Dmitri included this in MODE-1092.