Class PrivateSave
Base-class for INSERT, UPDATE and DELETE commands. Contains abstract methods that are common for all sub-classes.
Inherited Members
Namespace: SuperOffice.Data.SQL
Assembly: SoDataBase.dll
Syntax
public abstract class PrivateSave : SqlCommand, ISoDataLookup, ISentryIgnorable
Constructors
PrivateSave()
Base-class for INSERT, UPDATE and DELETE commands. Contains abstract methods that are common for all sub-classes.
Declaration
protected PrivateSave()
Properties
DoNotWriteTraveltransactionLog
For internal/SuperOffice use only: Setting this to TRUE will make the TravelTransactionLoggerProcessor skip this update. Used when we for some reason DO NOT WANT the standard logging.
Declaration
public bool DoNotWriteTraveltransactionLog { get; set; }
Property Value
Type | Description |
---|---|
bool |
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 |
---|---|
bool |
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()
Calculating rights for all tables and field potentially covered by a Sentry can be a huge waste. This method should return only-and-all FieldInfos actually present in the data object, so the Sentry can avoid calculating stuff that isn't needed
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
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 |
---|---|
bool | 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 |
---|---|
bool | Returns false as PrivateSave does not support persisted field values. |
SetTicketLogAction(TicketLogAction, string)
Forces a query to log to the database with specified logAction and description.
Declaration
public void SetTicketLogAction(TicketLogAction logAction, string description = null)
Parameters
Type | Name | Description |
---|---|---|
TicketLogAction | logAction | LogAction to be logged |
string | description | Custom description in a log |
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 |