On Wed, Oct 27, 2010 at 21:13, [email protected] <[email protected]> wrote: > My understanding is that Node Identifier (UUID) is associated with nodes > that are of mixin type and if you try to get identifier of a non-mixin type > u get null. > But when I look at ${schemaObjectPrefix}BUNDLE table it has NODE_ID column > and it appears that all nodes have an id assigned...Confused. > Can somebody shed some light on this?
The JCR 1.0 API defines that a node only has a "public" UUID (node.getUUID()) when it has the mix:referenceable mixin assigned (or part of its primary node type). Internally, Jackrabbit always gives nodes a UUID which is also used in the persistence layer (which is a key-value store, key being UUID and value being a so-called node bundle with a node and all its properties). Hence you see the NODE_ID column in the sql-based persistence managers. This UUID is also exposed via getUUID(), but only if mix:referenceable is assigned. Note that JCR 2.0 deprecates getUUID() and replaces it by getIdentifier() which is not so strict, i.e. it also returns something for non-referenceable nodes, but also defines no structure of the string (could be anything that the implementation wants). In Jackrabbit 2.x, this always returns the UUID. Regards, Alex -- Alexander Klimetschek [email protected]
