[ 
https://issues.apache.org/jira/browse/OAK-713?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13609007#comment-13609007
 ] 

Marcel Reutegger commented on OAK-713:
--------------------------------------

The specification leaves it up to the implementation, which definition it 
picks. It may pick the named definition with the extra constraint or the 
residual without constraint.

Jackrabbit prefers the named definition when it can choose between named and 
residual definitions. E.g. if you have the following node type definition:

{code}
<'sling'='http://sling.apache.org/jcr/sling/1.0'>

[sling:AlmostUnstructured] > nt:unstructured
- myProp (string) < 'foo', 'bar'
{code}

You can only set a myProp property on a node of type sling:AlmostUnstructured 
if it has the value 'foo' or 'bar'. Attempting to set another String value will 
result in a constraint violation exception.
                
> Automatic property type conversion
> ----------------------------------
>
>                 Key: OAK-713
>                 URL: https://issues.apache.org/jira/browse/OAK-713
>             Project: Jackrabbit Oak
>          Issue Type: Sub-task
>          Components: core, jcr
>            Reporter: Jukka Zitting
>            Assignee: Jukka Zitting
>            Priority: Minor
>
> It would be nice if, instead of throwing a validation error, Oak could 
> automatically do basic property type conversions that lose no content. For 
> example a single value could automatically be transformed to a multi-valued 
> property when required by the matching property definition.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to