Show / Hide Table of Contents

Class PrivateSave

Base-class for INSERT, UPDATE and DELETE commands. Contains abstract methods that are common for all sub-classes.

Inheritance
Object
SqlCommand
PrivateSave
TableRowBase
Delete
Insert
Update
Implements
ISoDataLookup
ISentryIgnorable
Inherited Members
SqlCommand.Origin
SqlCommand.AddIgnoreAutoSentryTableInfo(TableInfo)
SqlCommand.AddIgnoreAutoSentryTableInfo(IEnumerable<TableInfo>)
SqlCommand.RemoveIgnoreAutoSentryTableInfo(TableInfo)
SqlCommand.ClearIgnoreAutoSentryTableInfos()
SqlCommand.IsAutoSentryIgnoredOnTableInfo(TableInfo)
SqlCommand.GetPrivateSaves()
SqlCommand.GetInserts()
SqlCommand.GetUpdates()
SqlCommand.GetDeletes()
SqlCommand.GetSelect()
SqlCommand.SqlType
SqlCommand.AutoSentryIgnoredTables
Object.ToString()
Object.Equals(Object)
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Namespace: SuperOffice.Data.SQL
Assembly: SoDataBase.dll
Syntax
public abstract class PrivateSave : SqlCommand, ISoDataLookup, ISentryIgnorable

Constructors

PrivateSave()

Declaration
protected PrivateSave()

Properties

InnerFieldValuePairs

Container for the fields and values that belong to the current sql-command.

Declaration
protected abstract ArgumentParameterCollection InnerFieldValuePairs { get; }
Property Value
Type Description
ArgumentParameterCollection

InnerPrimaryKey

The primary key needed to decide which specific row to alter with the current sql-command.

Declaration
protected abstract FieldInfo InnerPrimaryKey { get; }
Property Value
Type Description
FieldInfo

InnerPrimaryKeyValue

The actual value the primary key must have.

Declaration
protected abstract Parameter InnerPrimaryKeyValue { get; }
Property Value
Type Description
Parameter

The inner primary key value.

IsSentryIgnored

Get value indicating whether sentry is ignored on the current object for the current thread.

Declaration
public virtual bool IsSentryIgnored { get; }
Property Value
Type Description
Boolean

Methods

BeginIgnoreSentryCheck()

Starts the process of ignoring sentry on the object implementing the interface on the current thread.

Declaration
public virtual IgnoreSentryCheck BeginIgnoreSentryCheck()
Returns
Type Description
IgnoreSentryCheck

Disposable object that calls EndIgnoreSentryCheck() on Dispose.

CloneToBasicUpdatingQuery()

This partial implementation of Clone handles queries that are of SqlType Insert, Update or Delete. Depending on the type, you'll get back an Insert, Update or Delete object.

Declaration
public PrivateSave CloneToBasicUpdatingQuery()
Returns
Type Description
PrivateSave

Insert, Update or Delete object

Remarks

This implementation is based on the fact that HDB classes inherit the PrivateSave interface, without implementing it by actually BEING an Insert, Update or Delete. Simultaneously, we would like to treat them as the basic Insert, Update or Delete type (in cases where that is relevant).

This method will therefore create a new Insert, Update or Delete query, populate it with relevant data from itself, and return it as an object.

Exceptions
Type Condition
SoIllegalOperationException

You will get an exception if you pass in something that is not one of the three basic updating query types.

EndIgnoreSentryCheck()

Ends the process of ignoring sentry on the object implementing the interface on the current thread.

Declaration
public virtual void EndIgnoreSentryCheck()

GetFieldValue(FieldInfo)

Get the value of a field

Declaration
public virtual object GetFieldValue(FieldInfo field)
Parameters
Type Name Description
FieldInfo field

Specification of a field

Returns
Type Description
Object

Field value, such as an int, DateTime, string ...

GetKnownFields()

Declaration
public List<FieldInfo> GetKnownFields()
Returns
Type Description
List<FieldInfo>

GetPersistedFieldValue(FieldInfo)

PrivateSave does not support persisted field values.

Declaration
public virtual object GetPersistedFieldValue(FieldInfo field)
Parameters
Type Name Description
FieldInfo field
Returns
Type Description
Object

Exception is allways thrown.

Exceptions
Type Condition
SoNotImplementedException

Allways thrown as PrivateSave does not support persisted field values.

GetTableInfos()

Obtain a list of all tables involved in the query.

Declaration
public override TableInfo[] GetTableInfos()
Returns
Type Description
TableInfo[]

List of all tables involved.

Overrides
SqlCommand.GetTableInfos()

IsGhostField(FieldInfo)

Check if there is actually a valid value for the given field. If not, then this field is called a 'ghost'. At this level, that is the same as having a null FieldValue

Declaration
public virtual bool IsGhostField(FieldInfo field)
Parameters
Type Name Description
FieldInfo field

Specification of a field

Returns
Type Description
Boolean

True if the field is a 'ghost', i.e., if it has NO valid known value

IsPersistedFieldValueKnown(FieldInfo)

PrivateSave does not support persisted field values.

Declaration
public virtual bool IsPersistedFieldValueKnown(FieldInfo field)
Parameters
Type Name Description
FieldInfo field
Returns
Type Description
Boolean

Returns false as PrivateSave does not support persisted field values.

Events

OnUpdateField

This method is triggered by the Data layer if it has updated - manipulated - the data in a query, and the client might wish to know. Subscribe to this event if YOU are interested in changes that happen behind the scenes.

Declaration
public event UpdateField OnUpdateField
Event Type
Type Description
UpdateField

Implements

ISoDataLookup
ISentryIgnorable

Extension Methods

EnumUtil.MapEnums<From, To>(From)
QueryExectionExtensions.ExecuteReader(SqlCommand, Boolean)
QueryExectionExtensions.ExecuteScalar<T>(SqlCommand)
QueryExectionExtensions.ExecuteNonQuery(SqlCommand)
Converters.MapEnums<From, To>(From)
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top