jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tobias Bocanegra" <tobias.bocane...@day.com>
Subject Re: versioning / reference question
Date Sat, 29 Jul 2006 14:29:32 GMT
hi ben,
the constraints are or'd. so your example should work, if you really
pass the frozen node and not the version node.

regards, toby

On 7/28/06, R. Ben Truitt <btruitt@rackspace.com> wrote:
> 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
>


-- 
-----------------------------------------< tobias.bocanegra@day.com >---
Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel
T +41 61 226 98 98, F +41 61 226 98 97
-----------------------------------------------< http://www.day.com >---

Mime
View raw message