This document is provided on an "AS IS" basis without warranties of any kind. Smartsite iXperion class libraries may change in future releases.
Base class for all storage handlers
Namespace: Smartsite.Data
Assembly: Smartsite.Data (in Smartsite.Data.dll)
Syntax
C# | Copy Code |
---|---|
public abstract class StorageHandler |
Visual Basic (Declaration) | Copy Code |
---|---|
Public MustInherit Class StorageHandler |
Remarks
Builder a storage handler in Smartsite 6 is quiet different from a storage handler
in Smartsite 5. If you wish to build a storage handler, please take the following in account.
- The CreateSchema method is supposed to create all the required tables and columns in the given MetaDataSet. All required fields should be created for common scenarios like a user that creates a schema, fills it with data and calls the save method on the MetaType. Ideally the restrictions on the columns (e.g. DataType, AllowDBNull etc) are as strict as possible but this is not required. It is allowed that on some occasions, the CreateSchema(MetaType, MetaDataSet, CreateSchemaSettings) method may not be able to generate all the columns in a table because the existance of some columns might depend on the primary key of the loaded data. The generated schema should be however as complete as possible.
- The Load method loads the data that belongs to all the primary keys, including cross tables and external tables. If the LoadFields indicates that the storage handler should not load a logical field of the MetaType, the storage handler should try to respect that. In some cases however, it is very inefficient to load the data afterwards (e.g. load Nr and Title field but ignore the Description) and the storage handler is allowed to ignore such a request.
- The Save method should save all the modified data in the MetaDataSet. The RowState of a DataRow in a DataTable indicates whether or not a DataRow is modified. The RowState may be Unchanged, Added, Modified or Deleted.
- Storage handlers are now only called once per operation and not per field. This gives the storage handler the ability to accumulate several operations in one single operation and thus increase the performance of a save operation.
- Storage handlers that access the database are supposed to use the Db property in the settings parameter. The .DbSecurityContext points to the users default database which might not the correct one for this operation.
- A MetaDataSet that is created or filled by the CreateSchema and Load methods may only contains value types or arrays of a value type. If that's not the case, the meta layer may not be able to serialize the MetaDataSet and use it for versioning and outscaling.
- Every save operation is performed within a database transaction and every storage handler is must use this transaction to perform its database operations.
Inheritance Hierarchy
System..::..Object
Smartsite.Data..::..StorageHandler
Smartsite.Data..::..FileLinkStorage
Smartsite.Data..::..DatabaseStorage
Smartsite.Data..::..FileStorage
Smartsite.Data..::..StorageHandler
Smartsite.Data..::..FileLinkStorage
Smartsite.Data..::..DatabaseStorage
Smartsite.Data..::..FileStorage
See Also
StorageHandler Members
Smartsite.Data Namespace