jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marcel Reutegger" <marcel.reuteg...@gmx.net>
Subject Re: 3.1.3.1 Removing Items
Date Tue, 24 Jul 2007 07:29:08 GMT
> 1) Should Node.setProperty(null) throw an Exception?
> Most people tend to agree it should, but it would be
> a problem for backward compatibility.

I also think that setting a property to null should throw a NullPointerException. But since
it's already specified and noone forces you to use it (you can still call Item.remove()),
I tend to say that the spec shouldn't change here to not break existing code.

> 2) Should JCR support nullable properties?
> Some say yes, some no. Let's see what other systems do:
> * XML: No (an empty string is not null)
> * Files: No (an empty file is not null)
> * HTTP: No
> * Properties files: No
> * Windows registry (if I may): No
> * LDAP: No? (not sure)
> * SQL: Yes (there is no other way to say 'the property is not set')
> * Java Hash tables: Hashtable no, HashMap yes
> 
> SQL is the only one supporting it, and it is a major pain there.
> Therefore, I suggest to not support nullable properties in JCR.

I also think JCR shouldn't support properties that are set to null. If you want to allow that
you will have to change the behaviour of lots of methods. e.g. what will Property.getLong()
return? It's just not possible to return a 'null' value here because the value range of the
long primitive type does know such a value. And after all the underlying datamodel for JCR-XPath
does not have null values either.

regards
 marcel
-- 
GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail

Mime
View raw message