jackrabbit-oak-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jukka Zitting <jukka.zitt...@gmail.com>
Subject Re: What does 'OAK_NAMED_PROPERTY_DEFINITIONS' represent in node type management?
Date Thu, 26 Sep 2013 15:39:26 GMT
Hi,

On Thu, Sep 26, 2013 at 10:56 AM, Alex Parvulescu
<alex.parvulescu@gmail.com> wrote:
> I'm working on a refactoring for OAK-1048 and i ran into a bit of code that
> I don't know how to translate into jcr code.
>
> Expanding a 'select * from...' means reading the node type definition and
> replacing the '*' part with the property names.
> In oak this happens via a call
> to nodeType.getNames(OAK_NAMED_SINGLE_VALUED_PROPERTIES)
>  which translated into just 'jcr:primaryType' .

nodeType.getNames(OAK_NAMED_SINGLE_VALUED_PROPERTIES) returns the
names of the named (i.e. not residual) single-valued properties
defined by the given nodeType (and it's supertypes). For something
like "nt:unstructured" that's just "jcr:primaryType" as there are no
other named and single-valued property definitions.

> The trouble begins when I translate this into jcr calls
> to: NodeType#getPropertyDefinitions which returns 2 names:
> 'jcr:primaryType' and 'jcr:mixinTypes'.

getPropertyDefinitions() returns all property definitions both named
and residual, single- and multi-valued.

> Which behavior is correct?

Both, they do different things.

What's the higher level goal you're trying to achieve?
SelectorImpl.getWildcardColumns()?

I vaguely remember some reason why I needed to return just
*single-valued property names* (instead of both single- and
multi-valued) from that method, but can't recall the details. Perhaps
just a mistake?

BR,

Jukka Zitting

Mime
View raw message