next up previous contents
Next: ValidationExceptions Up: Validation Previous: Validation   Contents

Mandatory, Length

Fields can be defined mandatory at two levels. On the 'field' node the tag required=true, this will add a 'NOT NULL' directive do the database schema and assert that this field exists on validation. If the field is required for business reasons, but needs to be stored in any case the required=true tag can be added in the 'validate' node.
<field name="workAddress" >
   <sql name="w_add" inline="true" prefix="work"/>
   <validate required="true" />
Length validations are generated automatically for each string using the len=''size'' tag.