Thursday, 11 February 2016

Remove a Node property in JCR

How to delete a Node property in JCR 

When you are working on AEM tool or with any JCR repository based environment, it is sometimes a requirement to add and delete properties of a node.

Heres how to add a property to a node in JCR.

To delete a property of a Node in JCR we can use either of the the following code in Java.

1. Get the property and remove it by calling the remove() method over the Node property.


2. Set the property to NULL in this manner. (Do not try to set it directly without typecasting)


No comments:

Post a Comment

Coder Magnet
CoderMagnet is full of resources from our daily development activities. It has solutions for common problematic scenarios in technologies like Java 8, AEM, JCR and also occasionally gives you tips on Blogger as well.