jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From IvanLatysh <i...@yourmail.com>
Subject 3.1.3.1 Removing Items
Date Thu, 19 Jul 2007 15:08:44 GMT
Hello All!

  I want to draw your attention to:
    3.1.3.1 Removing Items

   I considered deletion of the property by setting it's value to null as a side 
effect that need to be addressed in the next spec version. But now I can see 
that the same undesirable behavior preserved in JCR 2.0 spec.

   The NULL value is a valid meaningful value and most of the persistence 
engines obey that and will not remove the entity just because it's value is null.

   An example:
    1) You do not expect DB engine to remove the column from your table when all 
rows has NULL in this column.

    2) XML element or attribute will not be removed when it's value set to null
       Consider following XML snippets:
        <xsd:element name="shipDate" type="xsd:date" nillable="true"/>
        ...
        1) <ship-date calendar="gregorian">2007-01-01</ship-date>
        2) <ship-date calendar=""/>

        element or attribute will not be removed just because it's value is 
null.

   Deleting the property or node and setting the value is a two different use-cases.

   Also JCR API is not consistent in this matter, when consistency is most 
important part of any spec.

   Here is inconsistence that I refer to:
   1) to delete the Node we call: myNode.remove();
   2) to delete the Property we call: p.setValue((Value)null);

   In the second case I expect to see: p.remove();

   === Proposal ===========================================

   * Setting property to NULL will set property value to NULL without any side 
effects, such as removing a property.

   * To remove a property we call: p.remove();

   ========================================================

-- 
Ivan Latysh
ivan@yourmail.com

Mime
View raw message