Daniel,

Thanks for the reply, but I don't see how this uses the REFERENCE property to 
point to another node?

Can anyone else enlighten me?

Thanks,

Paul.

-----Original Message-----
From: Daniel Manzke [mailto:[email protected]] 
Sent: 01 July 2009 16:57
To: [email protected]
Subject: Re: Newbie: PropertyType.REFERENCE

Hi Paul,
here is a snippet.

Node rootNode = session.getRootNode();
Node record = rootNode.getNode(recordPath); //retrieves a node for an
electronical record
Node document = rootNode.getNode(documentPath); //retrieves a node for an
document in another record
*Value value = session.getValueFactory().createValue(document); //creates
the reference value*
*record.setProperty("forge:Referenzen", new Value[]{value}); //setting the
reference property*
session.save();


I don't know if this is the best way. If I remember right, I took the way
out of the TCK-Tests. ;)


Greets,
Daniel

2009/7/1 BOWLER Paul <[email protected]>

> Can anyone demonstrate (in code) how to set one Node to point to another
> Node using node.setProperty(xxx, xxx, PropertyType.REFERENCE).
>
> I can't find any examples anywhere on how to do this!
>
> Thanks,
>
> Paul.
>
> P.S. Is there a good JCR book available that I can read?
>



-- 
Mit freundlichen Grüßen

Daniel Manzke

Reply via email to