Hi -
I am fairly new to JCR, and am trying to figure out how to do the
below scenario:
I've created two node types, myns:typeA and myns:typeB.
myns:typeA has as a supertype mix:versionable. myns:typeB has as a
property:
- myns:typeA_reference (reference) primary < 'myns:typeA'
So far so good. I can get create NodeA of type myns:typeA and NodeB
of myns:typeB, and have NodeB hold a reference to NodeA. Sweet.
But what I'd *like* to be able to do, is to have NodeB hold a
reference to any version (past or present) of NodeA. I tried
modifying my definition for myns:typeB to this:
- myns:typeA_reference (reference) primary <
'myns:typeA','nt:frozenNode'
But, when I try to add set the reference property
"myns:typeA_reference" to refer to a previous version of NodeA, I get
this exception:
javax.jcr.nodetype.ConstraintViolationException: [node path here]:
does not satisfy the value constraint myns:typeA
So my questions are:
1) Since the JCR spec says that constraints are or'd together, it
seems like I shouldn't get this exception. What am I missing here?
2) I'm not very sure I am thinking about this in the right way. Is
there a better way to refer to an arbitrary version of NodeA from NodeB?
Thanks for your help!!
-Ben
|