Overview Support Download Purchase

Schema

TurnObjects in the system are defined by their schema. The schema definition contains basic information about how the object is identified and acts inside the system. The schema in turn will have properties that define the individual parts of the object. Schema are described in the TurnObjects area of the configuration file. Each schema is contained in a TurnSchema element. The following example describes the admin user in the Contact Database example.

Copy 

The table below defines the options for TurnSchema.

DescriptorTypeRequiredDefaultShort Description
BaseSchemaSchema emptyThe base schema that the object inherits properties from. If properties in the schema are the same name as the base schema, then the base property will be overridden.
InterfacesInterface emptyThe built in interfaces that the object will conform to. Special methods may be generated in the class to conform to the interface.
PrimaryPropertyTurnPropertyXnullThe property that is the primary key for the object.
SaveMethodSaveMethodTypeXCheckDuplicatesThe method in which the object is saved. See below for details on the save methods.
DataNamestringXemptyThe name for the object in the data store.
CollectionNamestringXemptyThe name for a collection of the object.
HistoryNamestring emptyThe name for the data store responsible for recording object history.
HistoryMethodHistoryMethodTypeXNoneHow the object should record it's history (changes etc.).
DisplayFormatstringXemptyHuman friendly string representing the object. Strings are formatted using String.Format methods.

Schema Save Methods

NoDuplicateCheck

No duplicate checking is done. If the object is loaded it will be updated. If the object is new and not loaded then the object will be inserted as a new record.

NoDuplicateCheck

CheckDuplicates

Check for duplicates if there is a new item. If the object is loaded then update it. If the object is new and a duplicate is found then the object becomes the found duplicate. If the object is new and a duplicate is not found then the object will be inserted.

CheckDuplicates

CheckDuplicatesAlwaysInsert

Check for duplicates. If there is a duplicate then the object becomes the found duplicate. If there is no duplicate found then insert the object as a new object. This makes it so no objects can be updated, but ensures that no objects are duplicate.

CheckDuplicatesAlwaysInsert

AlwaysInsert

Always insert the object as new. No duplicate checking is done and no objects are updated.

Custom Queries

Custom queries can be defined for collections of objects each schema defines. The queries are described after the TurnPropertyCollection. A query can be a simple static query or a dynamic query that will take inputs. The following example defines a query in the Real Estate example.

Copy 

The PriceSearch query will find objects that are between the specified prices. The two inputs are identified in the query by the ## qualifier. The inputs are further defined in the Inputs element by giving them a name (same as in the query), associating them with a property in the schema, and providing a prompt that can be used in UI.


© 2008 TurnObjects All rights reserved.  Legal  |  Privacy