On Tue, Nov 10, 2009 at 11:38, panos.athanasiou
<[email protected]> wrote:
> <nodeType hasOrderableChildNodes="true" isMixin="false"
> name="myNameSpace:AnotherEntity" primaryItemName="">
>               <supertypes>
>                        <supertype>myNameSpace:BaseEntity</supertype>
>                </supertypes>
>                <childNodeDefinition autoCreated="false"
>                        defaultPrimaryType="" mandatory="false"
>
> name="myNameSpace:BaseEntity"

This means that this child node definition only allows child nodes
named "myNameSpace:BaseEntity"...

>                        onParentVersion="IGNORE" protected="false" 
> sameNameSiblings="true">
>                <requiredPrimaryTypes>
>                        
> <requiredPrimaryType>myNameSpace:BaseEntity</requiredPrimaryType>
>                </requiredPrimaryTypes>
>        </childNodeDefinition>
> </nodeType>
>
>
> The actual code for creation looks like this:
>
> Node aNode = nodeOfTypeAnotherEntity.addNode("myNameSpace:YetAnotherEntity",
> "myNameSpace:YetAnotherEntity");

.. but here you are using "myNameSpace:YetAnotherEntity" (first param)
as node name. Thus it fails.

You should change the name of the child node definition (you can use
"*" to allow any node name) or the name used in the addNode() call.

See also 
http://jackrabbit.apache.org/node-type-notation.html#NodeTypeNotation-NodeName

BTW, I would recommend not to use the same names for node types and
node names, and only use namespaces in node names/property names if
they should really be distinctive. Otherwise using plain names is much
more readable and forces more standardization of names in and between
your applications.

Regards,
Alex

-- 
Alexander Klimetschek
[email protected]

Reply via email to