Configures a field to be automatically set by OpenAccess ORM when new instances and/or changes are committed. This may only be used on System.DateTime, byte, short and int fields. When used on a System.DateTime field the current time is set. When used on a sbyte, short or int field the current value of the field is incremented by one (wrapping to 0 at max positive value) or it is set to 1 for new objects. This is useful for automatically maintaining date created, date last modified and version number fields. Here is an example of using the autoset extension to fill the orderdate field:
|
Copy Code |
<field name="orderDate">
<extension key="autoset" value="created" />
</field>
|
The valid values for the autoset extension are as follows:
|
Autoset |
Description |
|
none |
Do not autoset field (default value) |
|
created |
Set on commit when new instance is created |
|
modified |
Set on commit when existing instance is modified |
|
both |
Set on commit when instance is created or modified |