Telerik OpenAccess Classic

Telerik OpenAccess ORM Send comments on this topic.
Dictionary Mapping
Programmer's Guide > OpenAccess ORM Classic (Old API) > Development Environment > Wizards and Dialogs > Forward Mapping Wizard > Field Mapping > Dictionary Mapping

Glossary Item Box

This documentation article is a legacy resource describing the functionality of the deprecated OpenAccess Classic only. The contemporary documentation of Telerik OpenAccess ORM is available here.

The purpose of this topic is to provide a detailed information about what will be visible in the Mapping Information view, when you select a Dictionary type in the treeview.

When you select a Dictionary type in the treeview, then the Mapping Information view should look like the snapshot below:

The following options are 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 field behavior. It can be readwrite, readonly or insertonly. The default is readwrite.
  • Item Type - the type of the array elements. In case of collection of similar types this option is disabled.
  • Cascading delete value object - in case of cascading deletes, if the referencing object is deleted, the referenced value object(s) will also be deleted (including their dependant-referenced objects). In this case, the dependent metadata extension entry is added to the App.config file.
  • Cascading delete key object - in case of cascading deletes, if the referencing object is deleted, the referenced key object(s) will also be deleted (including their dependant-referenced objects). In this case, the keys-dependent metadata extension entry is added to the App.config file.
  • Default fetch group - check this box to include the referenced items into 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.
  • Foreign Key Constraints - sets the name of the referential integrity constraint for the field. The following options are currently available:
    • 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 a custom name will be generated. Note that there is an additional text box, where you should specify the custom constraint name.
  • Join table - a join table holds the value for each element in the array map. OpenAccess allows you to modify the properties of the join table as well.
    • Table name - contains the name of the join table, which can be edited.
    • Create/Update table - check this box to automatically update the join table, while inserting an object into one of the referenced collections.
    • Columns - this contains a list of the columns of the Join table. The available columns are shown on the image below:

    • Name - contains the name of the selected column in the Columns combo box. OpenAccess gives you the ability to edit each column name at your discretion.
    • Type - contains a drop-down list with the supported database datatypes.
    • SQL Type -  contains a list with the supported SQL types for the selected database.
    • Length - sets the length (or precision) of the database column.
    • Scale - sets the scale (digits after the decimal point).

Hashtable Mapping

The situation is a little bit more different when you have a Hashtable mapping. The Hashtable doesn't contain similar type objects. In this case, when you select for first time the Hashtable field in the treeview, the Mapping Information view should look like the snapshot below:

OpenAccess says that you should define the ItemType first. Clicking the Choose ItemType button will open the ItemType of field wizard (dialog). The dialog is shown on the snapshot below:

The dialog contains two tab pages:

  • Search - StartsWith - the StartsWith search, contains all persistent classes and structs that can be used as an ItemType. The Select Item Type combobox contains the fully qualified name of the class or struct.
  • Search - OccurrenceOf - the OccurrenceOf Search, checks if the entered string occurs in any fully qualified class name or struct name, in the active project or in all projects. If it does, it is added to the ListView. The tab page is shown on the image below.

Once you've defined the ItemType for the Hashtable, all available settings in the Mapping Information view are absolutely the same as the Dictionary mapping settings (described at the beginning of the topic).