Characteristics, methods, and properties of the data object

In Flexberry ORM data objects instances of classes are called heirs of the abstract class ICSSoft.STORMNET.DataObject. For data objects Flexberry generators generate code for class .Net CLR-compliant language (C#, VB, etc.).

Data objects in the model

Classes of data objects are described in class diagram in Flexberry Designer and have the stereotype implementation. In the description of the data object are specified attributes, context and metadata.

The attributes of the data object can be of two types standard (described in the diagram) and dynamic dynamic properties of the data object. If the attribute value is not supposed to be placed in the repository, it can be declared as phranky. In the description of the attributes may be assigned to the default values.

Also Flexberry ORM supports several types of links: inheritance, artisans and Decalogue communication.

The data objects may be linked to additional information (meta-information), for example, views or picture.

Stereotype implementation is the default value, i.e. when developing the chart it can be omitted leaving a blank.

Data objects at run time

The life cycle of a data object traditionally consists of three stages:

  • Create.
  • Treatment.
  • Save.

Create a data object

The data object can be created in the following ways:

Processing of the data object

One of the main attributes of an object is object key, for which property is used PrimaryKey. In most cases, the key is the global unique identifier (GUID), although if necessary, can be used other types.

The most common problems in the processing data objects:

Saving the data object in the repository

To save the data object uses the methods of data service UpdateObject/UpdateObjects. When working with data objects important concepts are the status of objects, the upload status and copy data.

The basic properties and methods ICSSoft.STORMNET.DataObject

Work with a copy of the data

GetDataCopy

Assign: Get the internal copy of the data object

Signature:

DataObject ICSSoft.STORMNET.DataObject.GetDataCopy()

InitDataCopy

Assign to Initialize the copy of the data

Settings:

DataObjectCache

Signature:

// 1 
void ICSSoft.STORMNET.DataObject.InitDataCopy()

// 2 
void ICSSoft.STORMNET.DataObject.InitDataCopy(DataObjectCache DataObjectCache)

SetDataCopy

Assign: Set the internal copy of the data object

Settings:

value - Set object as a copy of an existing

Signature:

void ICSSoft.STORMNET.DataObject.SetDataCopy (DataObject value)

Getting and setting the state of the object

ContainsAlteredProps

Assign: Set whether the values of object properties in comparison with internal copy of

Signature:

bool ICSSoft.STORMNET.DataObject.ContainsAlteredProps()

GetAlteredPropertyNames

Assign: Returns a list of properties (attributes, supervisors, datalow), the values of which are changed in comparison with the internal copy of the object.

Signature:

string[] ICSSoft.STORMNET.DataObject.GetAlteredPropertyNames()

CheckNotNullProperties

Assign: Return a list of blank fields (values can’t be empty according to data model)

Settings:

  • detailSkip - Skip if you check the deleted detaily. A dictionary with a list of the types of datalow and flags for them. If detail not in the dictionary or a value for it to False, then check detail not to be missed. The parameter can be null.
  • view - the View on which properties are checked and the return of property title.
  • returnCaptions - true if the necessity to return the header properties from the view, not the names of the properties, false otherwise.

Signature:

// 1 
public string[] CheckNotNullProperties()

// 2 
string [] ICSSoft.STORMNET.DataObject.CheckNotNullProperties (Dictionary<Type, bool> detailSkip)

// 3 
public string[] CheckNotNullProperties(View view, bool returnCaptions)

// 4 
public string[] CheckNotNullProperties(View view, bool returnCaptions, Dictionary<Type, bool> detailSkip)

GetStatus

Assign: getting the value of object status

Settings:

recountIfAutoaltered - update value of the force (if a class with automatic calculation status)

Signature:

// 1 
ObjectStatus ICSSoft.STORMNET.DataObject.GetStatus()

// 2 
ObjectStatus ICSSoft.STORMNET.DataObject.GetStatus(bool recountIfAutoaltered)

SetLoadingState

Assign: set the status of the download.

Settings:

newState - load Status, set by the object.

Signature:

void ICSSoft.STORMNET.DataObject.SetLoadingState (LoadingState newState)

SetLoadedProperties

Assign: set the status of the download.

Settings:

newState - load Status, set by the object.

Signature:

void ICSSoft.STORMNET.DataObject.SetLoadingState (LoadingState newState)

SetStatus

Assign: set status

Settings:

newState - Status, set by the object.

Signature:

virtual void ICSSoft.STORMNET.DataObject.SetStatus (ObjectStatus newState)

Copying and duplication of data objects

CopyTo

Assign to Create copy of the data object. If the resulting copy of the object will be placed in storage, it is necessary to call the methods InitDataCopy or ClearDataCopy.

Settings:

  • toObject = object this, which
  • CreateDataObjectsCopy - true - to create copies of linked objects, false - limited to copying and pasting the link
  • PrimaryKeyCopy - true - copy primary keys
  • UseParentCaching - use a previously-installed caching

Signature:

  virtual void ICSSoft.STORMNET.DataObject.CopyTo(DataObject toObject,  
  bool  CreateDataObjectsCopy,  
  bool  PrimaryKeyCopy,  
  bool  UseParentCaching  
 )

Prototyping

Assign A: Prototypicality

Settings:

withDetails - with or without detaylari

Signature:

```csharp virtual void ICSSoft.STORMNET.DataObject.Prototyping() virtual void ICSSoft.STORMNET.DataObject.Prototyping(bool withDetails)


#### SetExistObjectPrimaryKey

__Assign__: Set the primary key in the data object. The operation is performed Clear() object is assigned a primary key, SetLoadingState(LoadingState.LightLoaded); SetLoadedProperties("__PrimaryKey");

__Settings__:

`primaryKey` - primary key

__Signature__:

```csharp
void ICSSoft.STORMNET.DataObject.SetExistObjectPrimaryKey (object primaryKey)

Lock object

LockObject

Assign to Lock the object

Settings:

key key lock facility

Signature:

void ICSSoft.STORMNET.DataObject.LockObject(object key)

UnLockObject

Assign: to Unlock the object

Settings:

key - the key lock feature.

Signature:

void ICSSoft.STORMNET.DataObject.UnLockObject (object key)