jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "R. Ben Truitt" <btru...@rackspace.com>
Subject Re: versioning / reference question
Date Fri, 28 Jul 2006 22:20:25 GMT
Oh and a followup on this - if I remove all property value  
constraints, my tests pass as expected. Of course I'd prefer to  
constrain values to nodes of type myns:typeA or versions thereof.

On Jul 28, 2006, at 4:30 PM, R. Ben Truitt 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


Mime
View raw message