Table of Contents

Class DataTemplates

Namespace
TimeCockpit.Data.Database.StringTemplates
Assembly
TimeCockpit.Data.dll

Class to produce the template output

public class DataTemplates : SqlTransformBase
Inheritance
Object
DataTemplates
Inherited Members
Object.ToString()
Object.Equals(Object)
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()

Constructors

DataTemplates(StringBuilder, SqlDialect)

Initializes a new instance of the DataTemplates class.

public DataTemplates(StringBuilder generationEnvironment, SqlDialect dialect)

Parameters

generationEnvironment StringBuilder

the target stringbuilder to write to.

dialect SqlDialect

the SQL dialect.

DataTemplates(SqlDialect)

Initializes a new instnace of the DataTemplates class.

public DataTemplates(SqlDialect dialect)

Parameters

dialect SqlDialect

the SQL dialect this data template is for.

Methods

AddBlobsOfObjectsToGarbageCollection(String, ModelEntityBase, BinaryProperty)

writes an insert statement to adds blobs from objects to garbage collection.

public void AddBlobsOfObjectsToGarbageCollection(string schema, ModelEntityBase entity, BinaryProperty blobProperty)

Parameters

schema String

the schema to use.

entity ModelEntityBase

the target entity

blobProperty BinaryProperty

the blob property to collect for.

AddBlobsToGarbageCollection(String, ModelEntityBase, BinaryProperty, Object)

writes a command to add blobs to garbage collection.

public void AddBlobsToGarbageCollection(string schema, ModelEntityBase entity, BinaryProperty blobProperty, object newBlobGuid)

Parameters

schema String

the schema to use.

entity ModelEntityBase

the target model entity

blobProperty BinaryProperty

the propert to write for.

newBlobGuid Object

a guid of the new blob (optional).

AddBlobToFetchQueueCommand(String)

writes an insert statement to add a blob to the chunk fetch queue.

public void AddBlobToFetchQueueCommand(string schema)

Parameters

schema String

the schema to use.

AddInstalledBatch(String)

Writes an insert statement to add a new installed batch.

public void AddInstalledBatch(string schema)

Parameters

schema String

the schema to use.

AddInstalledFeature(String)

writes an insert statement to add an installed feature.

public void AddInstalledFeature(string schema)

Parameters

schema String

the schema to use.

AttachClient(String)

writes an insert statement to add a new client to the SYS_SyncClient table.

public void AttachClient(string schema)

Parameters

schema String

the schema to use.

CheckInstallBatchTableInstalled(String)

Writes a select statement to check whether the table 'SYS_InstalledBatch' is available.

public void CheckInstallBatchTableInstalled(string schema)

Parameters

schema String

the schema to use.

CleanupGraveyard(String, Boolean)

writes a delete from statement to do a graveyard cleanup

public void CleanupGraveyard(string schema, bool serverGeneratedTime)

Parameters

schema String

the schema to create the sql for.

serverGeneratedTime Boolean

Delete(String, ModelEntityBase, IEnumerable<IEnumerable<Relation>>)

Writes a delete statement to the generation environment.

public void Delete(string schema, ModelEntityBase entity, IEnumerable<IEnumerable<Relation>> relationDependencyPath)

Parameters

schema String

the schema to use.

entity ModelEntityBase

the target entity.

relationDependencyPath IEnumerable<IEnumerable<Relation>>

the relation dependency paths (used for on delete cascade).

DeleteMultiple(String, ModelEntityBase)

writes a delete multiple statement to the generation environment.

public void DeleteMultiple(string schema, ModelEntityBase entity)

Parameters

schema String

the schema to use.

entity ModelEntityBase

the model entity to use.

DependencyHierarchy(String, DependencyHierarchy)

Join clause for included relations Note that this template must be applied to a list of RelationReference objects

public void DependencyHierarchy(string schema, DependencyHierarchy it)

Parameters

schema String

the schema to use.

it DependencyHierarchy

the dependency hierarchy.

DetachClient(String)

writes an update statement to remove a sync client.

public void DetachClient(string schema)

Parameters

schema String

the schema to use.

ExecuteDatabaseCommandOnServer(String, String, Boolean, Boolean)

Writes an sql statement to execute another common on the server with a transaction.

public void ExecuteDatabaseCommandOnServer(string schema, string command, bool isSynced, bool transactionActive)

Parameters

schema String

the schema to use.

command String

the command to execute.

isSynced Boolean

if synced, the current version is increased by one with an update lock.

transactionActive Boolean

Indicates whether the datalayer assumes an active transaction.

GetActiveSyncClient(String)

writes a select statement to get the active sync client.

public void GetActiveSyncClient(string schema)

Parameters

schema String

the schema to use.

GetBlobsFromFetchQueueCommand(String)

wrties a select statement to fetch the blobs from the chunk fetch queue.

public void GetBlobsFromFetchQueueCommand(string schema)

Parameters

schema String

the schema to use.

GetCurrentVersion(String)

Writes a select statement to get the current version.

public void GetCurrentVersion(string schema)

Parameters

schema String

the schema to use.

GetDeprecatedSyncClient(String)

writes a select statement to get the deprecated sync clients.

public void GetDeprecatedSyncClient(string schema)

Parameters

schema String

the schema to use.

GetGarbageBlobs(String)

writes a select statement to get the top 100 next garbage blobs.

public void GetGarbageBlobs(string schema)

Parameters

schema String

the schema to use.

GetLastReceivedAnchor(String)

Writes a select statement to get the LastReceived anchor.

public void GetLastReceivedAnchor(string schema)

Parameters

schema String

the schema to use.

GetLastSentAnchor(String)

Writes a select statement to Get the LastSentAnchor.

public void GetLastSentAnchor(string schema)

Parameters

schema String

the schema to use.

GetLastUpdateVersionsOfEntities(String, String[])

writes a select statement to get last update versions of all entities.

public void GetLastUpdateVersionsOfEntities(string schema, string[] entities)

Parameters

schema String

the schema to use.

entities String[]

the entities to get the last update versions for.

GetLatestSuccessfulSyncDateOverAllClients(String)

writes a select statement to get the latest successful sync client of all clients.

public void GetLatestSuccessfulSyncDateOverAllClients(string schema)

Parameters

schema String

the schema to use.

GetSyncPeriodInfo(String)

writes a select statement to get the sync period information.

public void GetSyncPeriodInfo(string schema)

Parameters

schema String

the schema to use.

GetVersionInfo(String, ModelEntityBase)

writes a select statement to get the version information of a specific entity.

public void GetVersionInfo(string schema, ModelEntityBase entity)

Parameters

schema String

the schema to use.

entity ModelEntityBase

the target entity

GetVersionInfoOfDead(String)

writes a select statement to get the version information of a specific dead entity.

public void GetVersionInfoOfDead(string schema)

Parameters

schema String

the schema to use.

Insert(String, ModelEntityBase, StorageColumn[])

Writes an insert statement to the generation environment.

public void Insert(string schema, ModelEntityBase entity, StorageColumn[] columns)

Parameters

schema String

the schema to write.

entity ModelEntityBase

the target entity.

columns StorageColumn[]

the storage columns.

InsertDeletionDate()

writes the sync date.

public void InsertDeletionDate()

InsertSyncDate()

writes the sync date.

public void InsertSyncDate()

InstalledBatches(String)

Writes a select statement to get the installed batches.

public void InstalledBatches(string schema)

Parameters

schema String

the schema to use.

InstalledFeatures(String)

Writes a select statement to get all installed feature uuids.

public void InstalledFeatures(string schema)

Parameters

schema String

the schema to use.

IsInSchema(String)

writes a IsInSchema check

public void IsInSchema(string schema)

Parameters

schema String

the schema to create the sql for.

ReadLocalizedTextValues(String, EntityObject, Culture[])

read localized text values

public void ReadLocalizedTextValues(string schema, EntityObject entityObject, Culture[] cultures)

Parameters

schema String

the schema to create the sql for.

entityObject EntityObject

the entityobject to load the localizations for.

cultures Culture[]

the cultures to load for the entityobject.

RemoveBlobsFromFetchQueueCommand(String)

wrties a delete statement to remove a specific blob uuid from the chunk fetch queue.

public void RemoveBlobsFromFetchQueueCommand(string schema)

Parameters

schema String

the schema to use.

RemoveInstalledBatch(String)

Write the delete statement to remove an installed batch.

public void RemoveInstalledBatch(string schema)

Parameters

schema String

the schema to use.

RemoveInstalledFeature(String)

writes a delete statement to remove an installed feature.

public void RemoveInstalledFeature(string schema)

Parameters

schema String

the schema to use.

SetCurrentVersion(String)

writes an update statement to set the current version.

public void SetCurrentVersion(string schema)

Parameters

schema String

the schema to use.

SetLastReceivedAnchor(String)

Writes an update statement to set the LastReceivedAnchor.

public void SetLastReceivedAnchor(string schema)

Parameters

schema String

the schema to use.

SetLastSentAnchor(String)

Writes an update statement to update the LastSentAnchor.

public void SetLastSentAnchor(string schema)

Parameters

schema String

the schema to use.

SetServerReplicaId(String)

writes an update statement to set the replica id.

public void SetServerReplicaId(string schema)

Parameters

schema String

the schema to use.

StoreLocalizedTextValues(String, EntityObject)

store localized text values

public void StoreLocalizedTextValues(string schema, EntityObject entityObject)

Parameters

schema String

the schema to create the sql for.

entityObject EntityObject

the entityobject to load the localizations for.

SystemTables(String)

Creates a select statement returning the entities which have a System Ownership.

public void SystemTables(string schema)

Parameters

schema String

the schema to use.

TenantDatabaseVersion(String)

produces a select statement returning the tenant database version.

public void TenantDatabaseVersion(string schema)

Parameters

schema String

the schema to use.

TransformText()

Create the template output

public override string TransformText()

Returns

String

Update(String, ModelEntityBase, StorageColumn[])

Writes an update statement to the generation environment.

public void Update(string schema, ModelEntityBase entity, StorageColumn[] columns)

Parameters

schema String

the schema to use.

entity ModelEntityBase

the target entity.

columns StorageColumn[]

the storage columns.

UpdateSyncClientLastSuccessfulUpload(String)

Update LastSuccessfulUpload within SyncClient.

public void UpdateSyncClientLastSuccessfulUpload(string schema)

Parameters

schema String

The schema to use.

UpdateSyncClientLastSyncAttempt(String)

Update LastSyncAttempt within SyncClient.

public void UpdateSyncClientLastSyncAttempt(string schema)

Parameters

schema String

The schema to use.

UpdateSyncClientSuccessful(String)

writes an update statement to update the last successful sync of a sync client.

public void UpdateSyncClientSuccessful(string schema)

Parameters

schema String

the schema to use.

UpdateSyncClientUnSuccessful(String)

writes an update statement to update the last unsuccessful sync of a sync client.

public void UpdateSyncClientUnSuccessful(string schema)

Parameters

schema String

the schema to use.

UserTables(String)

Creates a select statement returning the entities which have a User Ownership.

public void UserTables(string schema)

Parameters

schema String

the schema to use.