The purpose of this section is to provide a detailed information about what will be visible in the Mapping Information view, when you select a reference field in the treeview.
When you select a reference type in the treeview, the Mapping Information view should look like the snapshot below:
The following options are available:
Foreign Ket Constraints - sets the name of the referential integrity constraint for the field. The following options are currently available:
- Transient (skip this field) - check this if the field should not be stored in the database.
- Serialize to Blob - check this if the field's value should be stored serialized into a Blob column.
- Field behavior - defines the fieldbehavior. It can be readwrite, readonly or insertonly. The default is readwrite.
- Database Column Name - sets the name of the database column.
- Database Column Type - contains a list with the supported database datatypes.
- Database Column SQL Type - contains a list with the supported SQL types for the selected database.
||If you want to have Unicode support with sql server, it is necessary to specify one of the "n-types" like nvarchar here.|
- Database Column Length - sets the length (or precision) of the database column.
- Database Column Scale - sets the scale (digits after the decimal point).
- Converter - currently the data converter feature is not implemented.
- Part of primary key - signals if the field is part of the primary key or not. This is specified by the identity class in case of multiple field identity and by the field that holds the identity information, in case of single field identity. In case of the internal identity, none of the users fields will serve as primary key, so this box is never checked while using internal identity. This option is read-only.
- Throw an exception on commit if a field is null - controls the treatment of null values. By default the field is mapped to a column that allows null values. If "throw an exception" is checked then the field is mapped to a column that does not allow null values. In such a case, an exception on commit time will be thrown, if the value of the field is null.
- Cascading delete - in case of cascading deletes, if a "Delete" occurs, the referenced object(s) will also be deleted (including their dependant referenced objects ...). The [OpenAccess.Depend] attribute is added to the referenced persistent class or to the persistent values in a collection or array.
- Default fetch group - controls whether the field is to be included, or not, in the default fetchgroup.
- Prefetch algorithm - set the type of join used to fetch the referenced instance (no, outer or inner). This can be used to solve the "N+1" database calls problem.
- Prefetch with Outer join - use an outer join to retrieve fields.
- Prefetch with Inner join - use an inner join to retrieve fields. Using an inner join allows the join to extend further across the object graph as other joins can be done from the joined table. However, rows will be lost if the reference contains null or the database referential integrity is invalid.
||Be careful while using inner joins because rows may be lost from queries.|
- Prefetch with No join - do not join to retrieve the fields.
- Generate with default name - a constraint with default name will be generated.
- Do not generate constraint - if you choose this option, then no constraint will be generated.
- Generate with custom name - if you choose this option, then a constraint with custom name will be generated. Note that there is an additional text box, where you should specify the custom constraint name.