You can specify that a repository item property is required by setting a property tag’s required attribute:

<property name="lastName" data-type="string" required="true" />

Then, if you also set the enforceRequiredProperties property of the GSARepository component to true (the default value), the repository checks to make sure all required properties are present when adding repository items and forbids the setting of a required property to null.

Make sure your repository definition corresponds to your database schema; if your database schema defines a property as NOT NULL, your repository definition should define the property with the required="true" attribute.

Note: If a property references an item that is defined in the database as NOT NULL but you cannot mark the property as required, indicate this by adding the references attribute tag and set its value to true and its data type to boolean. For example:

<property name="myProperty">
  <attribute name="references" value="true" data-type="boolean"/>

loading table of contents...