[ 
https://issues.apache.org/jira/browse/JCR-1119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12526690
 ] 

Christophe Lombart commented on JCR-1119:
-----------------------------------------

>Not sure, whether it makes absolute sense to define a property as mandatory in 
>the descriptor but not in the node type definition. Are there any >opinions on 
>that ?

Right now, I don't see a use case where it should possible. Maybe we can start 
with your proposal and if needed, we can review the code later. 



> SimpleFieldsHelper emits a lot warnings
> ---------------------------------------
>
>                 Key: JCR-1119
>                 URL: https://issues.apache.org/jira/browse/JCR-1119
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: jcr-mapping
>            Reporter: Felix Meschberger
>            Assignee: Felix Meschberger
>             Fix For: 1.4
>
>
> The SimpleFieldsHelper.retrieveSimpleField method is used to load JCR 
> properties into simple Java object fields according to the mapping 
> descriptor. If the node does not have the named property, a WARN message is 
> emited.
> If the missing property is defined as optional in the node type definition, 
> it is quite normal, that it may be missing. Therefore emitting a WARN message 
> does not seem appropriate. It would be better, to do the following (in order):
>    If the missing property is declared to be required in the descriptor, 
> throw an exception
>    else if the descriptor has a default value for the missing property, use 
> that value
>    else if the property is defined with a default value in the node type 
> definition, use that value
>    else emit a DEBUG message and leave the field undefined
> Not sure, whether it makes absolute sense to define a property as mandatory 
> in the descriptor but not in the node type definition. Are there any opinions 
> on that ?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to