Unique (attribute of property)

From JRapid

Jump to: navigation, search

The unique attribute prevents entering two items that have the same value in the property where uniqueness was specified.

Usage

 <property name = NAME label = LABEL unique="unique" />

Example

The unique attribute is useful when you want to differentiate two items entered by one of the entity‘s field, for example the last name of an employee.

 <entity name="Employee" label="Employee">
        ...
 	<property name="lastName" label="Last name" unique="unique" />
        ...
 </entity>

In this case you will prevent the case where two employees have the same name despite they work on different companies.

Personal tools