问题
how can I remove the property of a node in JAVA code? I have tried something like -
node.setProperty(propertyName, null);
Is there something specific which I can try?
回答1:
Supposing that you have a typo with your "setProperty" method, you may be getting ambigous method error. You should do type casting if so:
node.setProperty(propertyName, (Value)null);
or use remove method
node.getProperty(propertyName).remove();
session.save();
回答2:
you are missing
session.save();
来源:https://stackoverflow.com/questions/33995675/how-to-remove-a-property-of-a-cq-node-in-java