Default value features
Data object properties (or hidden properties) can be assigned by default values described by mapping.
Using DefaultFeature enumeration it's possible to extend basic functionality of default value assignment with...
- UseOnUpdate - use default value not only on insert, but on update also.
- SkipWhenAssigned - skip insert into table when PK value assigned explicitly.
- UpdateWhenAssigned - change insert operation over table to update when PK value assigned explicitly.
Last two of features is usable when data object 's primary table is linked with another table in data object mapping as one-to-one, and insert into base table can be skipped (or replaced with update statement) when it's primary key is assigned explicitly in application code.
This features helps logically combine mappings to hide technological entities, which don't reflect business object model of application.
Default features can be combined. For example:
DefaultFeature.UseOnUpdate | DefaultFeature.SkipWhenAssigned