cancel
Showing results for 
Search instead for 
Did you mean: 

What's more efficient? Get nodeRef from uuid or path?

spilby
Confirmed Champ
Confirmed Champ
Hi!

I have a NodeRef object of a node, and I want to save it on BD for use it in the future. From the NodeRef object I can obtain the uuid or the path, for example.

The question is… In order to save the correct information that I need to obtain the NodeRef later optimally (efficient and quickly, because the tree of nodes on Alfresco is too big), what is the best way?

For example, I can do this:

NodeRef ref = new NodeRef(uuid);


or I can do a lucene search with the path. But I don't know which is the best efficient way to obtain a NodeRef.

Thanks!



3 REPLIES 3

mrogers
Star Contributor
Star Contributor
Store the node ref.    that's what its for.   not parts of it.    You can't use a path since the node could move.   You may get away with the storing the  uuid as long as you only use one store ref.

spilby
Confirmed Champ
Confirmed Champ
But how can I store a NodeRef object on a database? Like a VARCHAR doing
nodeRef.toString()
method?

And in order to obtain the NodeRef object later, from the database, the correct way is doing:
NodeRef ref = new NodeRef(noderef);
? When noderef is the nodeRef.toString mentioned before.

mrogers
Star Contributor
Star Contributor
Yes.