Hi Anirban Majumdar,

Basically nt:unstructured is the node type which doesnot mandate any restriction. Any property can be added without declaration.

But you are in need of a node type where a particular property need to be mandatory. Try extending nt:resource. It will surely help.

[av:childNodeType] > nt:resource

- av:name  mandatory

- av:value

Best Regards,
Sunil Dhage



Hello everyone,

I've come across somewhat similar posts in the archive, but they all
primarily seemed to be dealing with nt:resource.

The problem I'm facing is that when I have a mandatory property
specified in a child node, then JackRabbit throws a
ConstraintViolationException [mandatory property does not exist]
whenever I try to save the contents of the parent node.

To put it programmatically,

I have a parent node:

[av:someParent] > nt:base

+ av:children [av:childNodeType]

= av:childNodeType

Multiple

[av:childNodeType] > nt:unstructured

- av:name

mandatory

- av:value

I have a bean class for someParent node, which contains a List of
childNode instances. In each of the instances I explicitly save the
"name" property. Then using OCM when I persist the parent node instance
- ocm.insert(parentNodeObj) - even this goes through fine. At the line
where I save the transient state of the repository - ocm.save() - I get
the ConstraintViolationException.

Any assistance will be truly appreciated.

--------

anirban


Reply via email to