Class SerializableObjectLayer
- Namespace
- DevExpress.Xpo
- Assembly
- DevExpress.Xpo.v24.1.dll
An object access layer used for units of work (or sessions) in distributed applications.
public class SerializableObjectLayer : ISerializableObjectLayer, ISerializableObjectLayerProvider, ISerializableObjectLayerEx, ICommandChannel, ICommandChannelAsync
- Inheritance
-
SerializableObjectLayer
- Implements
-
ICommandChannelICommandChannelAsync
- Inherited Members
Constructors
SerializableObjectLayer(Session)
Initializes a new instance of the SerializableObjectLayer class with a specified parent session.
public SerializableObjectLayer(Session parentSession)
Parameters
SerializableObjectLayer(Session, bool)
Initializes a new instance of the SerializableObjectLayer class with a specified parent session and the SerializableObjectLayer.ThroughCommitMode field value.
public SerializableObjectLayer(Session parentSession, bool throughCommitMode)
Parameters
parentSession
SessionA Session object specifying a parent session for the current object layer.
throughCommitMode
booltrue if the SerializableObjectLayer.CommitObjects method call should automatically commit changes in the parentSession to properly update key fields and fields with enabled optimistic locking in the object layer’s session; otherwise, false. The specified value initializes the object layer’s SerializableObjectLayer.ThroughCommitMode field.
Fields
ThroughCommitMode
Indicates if the SerializableObjectLayer.CommitObjects method call automatically commits changes in a parent session to properly update key fields and fields with enabled optimistic locking (decorated with the KeyAttribute or OptimisticLockingAttribute) in a nested session. To assign the ThroughCommitMode field, use the corresponding SerializableObjectLayer overloaded constructor.
public readonly bool ThroughCommitMode
Field Value
Properties
CanLoadCollectionObjects
Indicates if an object layer can call the SerializableObjectLayer.LoadCollectionObjects method to load collection properties.
[Browsable(false)]
public bool CanLoadCollectionObjects { get; }
Property Value
- bool
true if collections can be loaded via an object layer’s SerializableObjectLayer.LoadCollectionObjects method call; otherwise, false.
ObjectLayer
Returns the current SerializableObjectLayer object.
[Browsable(false)]
public ISerializableObjectLayer ObjectLayer { get; }
Property Value
- ISerializableObjectLayer
The current SerializableObjectLayer object cast to the ISerializableObjectLayer.
ParentSession
[Browsable(false)]
public Session ParentSession { get; }
Property Value
Methods
CommitObjects(XPDictionaryStub, XPObjectStubCollection, XPObjectStubCollection, LockingOption)
Performs object layer specific operations that are required to commit changes made to specified objects and return information on modified objects.
public CommitObjectStubsResult[] CommitObjects(XPDictionaryStub dictionary, XPObjectStubCollection objectsForDelete, XPObjectStubCollection objectsForSave, LockingOption lockingOption)
Parameters
dictionary
XPDictionaryStubAn XPDictionaryStub object that is a metadata information provider.
objectsForDelete
XPObjectStubCollectionAn XPObjectStubCollection object which contains information on objects marked for deletion.
objectsForSave
XPObjectStubCollectionAn XPObjectStubCollection object which contains information on objects marked for saving.
lockingOption
LockingOptionA LockingOption enumeration value specifying whether check for optimistic locking is made.
Returns
- CommitObjectStubsResult[]
An array of CommitObjectStubsResult objects containing information on modified objects.
CreateObjectType(string, string)
Performs object layer specific operations that are required to create an XPObjectType record.
public void CreateObjectType(string assemblyName, string typeName)
Parameters
assemblyName
stringA string value which specifies the assembly name to be assigned to the XPObjectType.AssemblyName property.
typeName
stringA string value, which specifies the type name to be assigned to the XPObjectType.TypeName property.
GetObjectsByKey(XPDictionaryStub, GetObjectStubsByKeyQuery[])
Performs object layer specific operations that are required to return information on persistent objects retrieved from a data store, using queries based on specified object types and key values.
public SerializableObjectLayerResult<XPObjectStubCollection[]> GetObjectsByKey(XPDictionaryStub dictionary, GetObjectStubsByKeyQuery[] queries)
Parameters
dictionary
XPDictionaryStubAn XPDictionaryStub object that is a metadata information provider.
queries
GetObjectStubsByKeyQuery[]An array of GetObjectStubsByKeyQuery objects, containing data for queries that retrieve persistent objects by specified object types and key values.
Returns
- SerializableObjectLayerResult<XPObjectStubCollection[]>
A SerializableObjectLayerResult instance that exposes an array of XPObjectStubCollection objects containing information on retrieved objects.
GetParentObjectsToDelete()
Performs object layer specific operations that are required to return information on persistent objects marked for deletion in parent sessions.
public SerializableObjectLayerResult<XPObjectStubCollection> GetParentObjectsToDelete()
Returns
- SerializableObjectLayerResult<XPObjectStubCollection>
A SerializableObjectLayerResult instance that exposes an XPObjectStubCollection object containing information on persistent objects marked for deletion in parent sessions.
GetParentObjectsToSave()
Performs object layer specific operations that are required to return information on persistent objects marked for saving in parent sessions.
public SerializableObjectLayerResult<XPObjectStubCollection> GetParentObjectsToSave()
Returns
- SerializableObjectLayerResult<XPObjectStubCollection>
A SerializableObjectLayerResult instance that exposes an XPObjectStubCollection object containing information on persistent objects loaded from the immediate parent session. XPObjectStubCollection elements match objects marked for saving in parent sessions.
GetParentTouchedClassInfos()
Performs object layer specific operations that are required to return metadata information on persistent objects modified in parent sessions.
public string[] GetParentTouchedClassInfos()
Returns
- string[]
An array of strings that can be used to identify metadata information for objects modified in parent sessions relative to an object layer’s session.
IsAuditEnabled(Session)
protected virtual bool IsAuditEnabled(Session session)
Parameters
session
Session
Returns
IsParentObjectToDelete(XPDictionaryStub, XPObjectStub)
Performs object layer specific operations that are required to determine if a specified object corresponds to an object marked for deletion in parent sessions.
public bool IsParentObjectToDelete(XPDictionaryStub dictionary, XPObjectStub theObject)
Parameters
dictionary
XPDictionaryStubAn XPDictionaryStub object that is a metadata information provider.
theObject
XPObjectStubAn XPObjectStub instance identifying an object layer session’s object to test.
Returns
- bool
true if the object identified by the theObject corresponds to one of the objects marked for deletion in parent sessions; otherwise, false.
IsParentObjectToSave(XPDictionaryStub, XPObjectStub)
Performs object layer specific operations that are required to determine if a specified object corresponds to an object marked for saving in parent sessions.
public bool IsParentObjectToSave(XPDictionaryStub dictionary, XPObjectStub theObject)
Parameters
dictionary
XPDictionaryStubAn XPDictionaryStub object that is a metadata information provider.
theObject
XPObjectStubAn XPObjectStub instance identifying an object layer session’s object to test.
Returns
- bool
true if the object identified by the theObject corresponds to one of the objects marked for saving in parent sessions; otherwise, false.
LoadCollectionObjects(XPDictionaryStub, string, XPObjectStub)
Performs object layer specific operations that are required to load a collection property using specified settings.
public SerializableObjectLayerResult<XPObjectStubCollection> LoadCollectionObjects(XPDictionaryStub dictionary, string refPropertyName, XPObjectStub ownerObject)
Parameters
dictionary
XPDictionaryStubAn XPDictionaryStub object that is a metadata information provider.
refPropertyName
stringA string value specifying the ownerObject‘s property that references a collection property.
ownerObject
XPObjectStubAn XPObjectStub specifying the object that owns the collection property.
Returns
- SerializableObjectLayerResult<XPObjectStubCollection>
A DevExpress.Xpo.SerializableObjectLayerResult`1<XPObjectStubCollection,> object which contains information on collection objects.
LoadDelayedProperties(XPDictionaryStub, XPObjectStub, string[])
Performs object layer specific operations that are required to load data to specific properties marked for delayed loading in a specified object.
public SerializableObjectLayerResult<object[]> LoadDelayedProperties(XPDictionaryStub dictionary, XPObjectStub theObject, string[] props)
Parameters
dictionary
XPDictionaryStubAn XPDictionaryStub object that is a metadata information provider.
theObject
XPObjectStubA persistent object containing delayed properties specified by the props.
props
string[]An array of strings specifying the delayed theObject‘s properties whose values are loaded.
Returns
- SerializableObjectLayerResult<object[]>
A SerializableObjectLayerResult instance that exposes an array of loaded property values corresponding to the props array elements.
LoadDelayedProperties(XPDictionaryStub, XPObjectStubCollection, string)
Performs object layer specific operations that are required to load data to a specific property marked for delayed loading in specified objects.
public SerializableObjectLayerResult<object[]> LoadDelayedProperties(XPDictionaryStub dictionary, XPObjectStubCollection objects, string property)
Parameters
dictionary
XPDictionaryStubAn XPDictionaryStub object that is a metadata information provider.
objects
XPObjectStubCollectionAn XPObjectStubCollection object which contains information on persistent objects containing the delayed property specified by the property.
property
stringA string value specifying a delayed property whose values are loaded.
Returns
- SerializableObjectLayerResult<object[]>
A SerializableObjectLayerResult instance that exposes an array of loaded property values corresponding to the objects collection elements.
LoadObjects(XPDictionaryStub, ObjectStubsQuery[])
Performs object layer specific operations that are required to load persistent objects using specified settings.
public SerializableObjectLayerResult<XPObjectStubCollection[]> LoadObjects(XPDictionaryStub dictionary, ObjectStubsQuery[] queries)
Parameters
dictionary
XPDictionaryStubAn XPDictionaryStub object that is a metadata information provider.
queries
ObjectStubsQuery[]An array of ObjectStubsQuery objects specifying queries that are executed to retrieve persistent objects.
Returns
- SerializableObjectLayerResult<XPObjectStubCollection[]>
A SerializableObjectLayerResult instance that exposes an array of XPObjectStubCollection object collections corresponding to the queries.
ObjectRetrievedFromParentSession(object)
protected virtual void ObjectRetrievedFromParentSession(object obj)
Parameters
obj
object
Purge()
Performs object layer specific operations that are required to remove all objects marked for deletion.
public PurgeResult Purge()
Returns
- PurgeResult
A PurgeResult object containing removal statistics (the number of objects processed, purged, etc.)
SelectData(XPDictionaryStub, ObjectStubsQuery, CriteriaOperatorCollection, CriteriaOperatorCollection, CriteriaOperator)
Performs object layer specific operations that are required to retrieve object data from a session, using specified query parameters.
public object[][] SelectData(XPDictionaryStub dictionary, ObjectStubsQuery query, CriteriaOperatorCollection properties, CriteriaOperatorCollection groupProperties, CriteriaOperator groupCriteria)
Parameters
dictionary
XPDictionaryStubAn XPDictionaryStub object that is a metadata information provider.
query
ObjectStubsQueryAn ObjectStubsQuery object specifying a query that is executed to retrieve persistent objects.
properties
CriteriaOperatorCollectionA DevExpress.Data.Filtering.CriteriaOperatorCollection object which specifies object properties to be retrieved.
groupProperties
CriteriaOperatorCollectionA DevExpress.Data.Filtering.CriteriaOperatorCollection object which specifies the grouping properties.
groupCriteria
CriteriaOperatorA DevExpress.Data.Filtering.CriteriaOperator descendant which specifies the grouping criteria for the retrieved objects.
Returns
- object[][]
A SerializableObjectLayerResult instance that exposes an array whose elements are property values corresponding to the properties of objects retrieved from the associated session.
SelectedData(IList<CriteriaOperator>, ref List<object[]>)
protected virtual void SelectedData(IList<CriteriaOperator> properties, ref List<object[]> data)
Parameters
SelectingData(XPClassInfo, ref CriteriaOperatorCollection, ref CriteriaOperator, ref CriteriaOperatorCollection, ref CriteriaOperator, ref SortingCollection)
protected virtual void SelectingData(XPClassInfo classInfo, ref CriteriaOperatorCollection properties, ref CriteriaOperator criteria, ref CriteriaOperatorCollection groupProperties, ref CriteriaOperator groupCriteria, ref SortingCollection sorting)
Parameters
classInfo
XPClassInfoproperties
CriteriaOperatorCollectioncriteria
CriteriaOperatorgroupProperties
CriteriaOperatorCollectiongroupCriteria
CriteriaOperatorsorting
SortingCollection