Class DataTemplates
Class to produce the template output
Inherited Members
Namespace: TimeCockpit.Data.Database.StringTemplates
Assembly: TimeCockpit.Data.dll
Syntax
public class DataTemplates : SqlTransformBase
Constructors
DataTemplates(StringBuilder, SqlDialect)
Initializes a new instance of the DataTemplates class.
Declaration
public DataTemplates(StringBuilder generationEnvironment, SqlDialect dialect)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Text.StringBuilder | generationEnvironment | the target stringbuilder to write to. |
| SqlDialect | dialect | the SQL dialect. |
DataTemplates(SqlDialect)
Initializes a new instnace of the DataTemplates class.
Declaration
public DataTemplates(SqlDialect dialect)
Parameters
| Type | Name | Description |
|---|---|---|
| SqlDialect | dialect | 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.
Declaration
public void AddBlobsOfObjectsToGarbageCollection(string schema, ModelEntityBase entity, BinaryProperty blobProperty)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
| ModelEntityBase | entity | the target entity |
| BinaryProperty | blobProperty | the blob property to collect for. |
AddBlobsToGarbageCollection(String, ModelEntityBase, BinaryProperty, Object)
writes a command to add blobs to garbage collection.
Declaration
public void AddBlobsToGarbageCollection(string schema, ModelEntityBase entity, BinaryProperty blobProperty, object newBlobGuid)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
| ModelEntityBase | entity | the target model entity |
| BinaryProperty | blobProperty | the propert to write for. |
| System.Object | newBlobGuid | a guid of the new blob (optional). |
AddBlobToFetchQueueCommand(String)
writes an insert statement to add a blob to the chunk fetch queue.
Declaration
public void AddBlobToFetchQueueCommand(string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
AddInstalledBatch(String)
Writes an insert statement to add a new installed batch.
Declaration
public void AddInstalledBatch(string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
AddInstalledFeature(String)
writes an insert statement to add an installed feature.
Declaration
public void AddInstalledFeature(string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
AttachClient(String)
writes an insert statement to add a new client to the SYS_SyncClient table.
Declaration
public void AttachClient(string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
CheckInstallBatchTableInstalled(String)
Writes a select statement to check whether the table 'SYS_InstalledBatch' is available.
Declaration
public void CheckInstallBatchTableInstalled(string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
CleanupGraveyard(String, Boolean)
writes a delete from statement to do a graveyard cleanup
Declaration
public void CleanupGraveyard(string schema, bool serverGeneratedTime)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to create the sql for. |
| System.Boolean | serverGeneratedTime |
Delete(String, ModelEntityBase, IEnumerable<IEnumerable<Relation>>)
Writes a delete statement to the generation environment.
Declaration
public void Delete(string schema, ModelEntityBase entity, IEnumerable<IEnumerable<Relation>> relationDependencyPath)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
| ModelEntityBase | entity | the target entity. |
| System.Collections.Generic.IEnumerable<System.Collections.Generic.IEnumerable<Relation>> | relationDependencyPath | the relation dependency paths (used for on delete cascade). |
DeleteMultiple(String, ModelEntityBase)
writes a delete multiple statement to the generation environment.
Declaration
public void DeleteMultiple(string schema, ModelEntityBase entity)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
| ModelEntityBase | entity | 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
Declaration
public void DependencyHierarchy(string schema, DependencyHierarchy it)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
| DependencyHierarchy | it | the dependency hierarchy. |
DetachClient(String)
writes an update statement to remove a sync client.
Declaration
public void DetachClient(string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
ExecuteDatabaseCommandOnServer(String, String, Boolean, Boolean)
Writes an sql statement to execute another common on the server with a transaction.
Declaration
public void ExecuteDatabaseCommandOnServer(string schema, string command, bool isSynced, bool transactionActive)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
| System.String | command | the command to execute. |
| System.Boolean | isSynced | if synced, the current version is increased by one with an update lock. |
| System.Boolean | transactionActive | Indicates whether the datalayer assumes an active transaction. |
GetActiveSyncClient(String)
writes a select statement to get the active sync client.
Declaration
public void GetActiveSyncClient(string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
GetBlobsFromFetchQueueCommand(String)
wrties a select statement to fetch the blobs from the chunk fetch queue.
Declaration
public void GetBlobsFromFetchQueueCommand(string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
GetCurrentVersion(String)
Writes a select statement to get the current version.
Declaration
public void GetCurrentVersion(string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
GetDeprecatedSyncClient(String)
writes a select statement to get the deprecated sync clients.
Declaration
public void GetDeprecatedSyncClient(string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
GetGarbageBlobs(String)
writes a select statement to get the top 100 next garbage blobs.
Declaration
public void GetGarbageBlobs(string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
GetLastReceivedAnchor(String)
Writes a select statement to get the LastReceived anchor.
Declaration
public void GetLastReceivedAnchor(string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
GetLastSentAnchor(String)
Writes a select statement to Get the LastSentAnchor.
Declaration
public void GetLastSentAnchor(string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
GetLastUpdateVersionsOfEntities(String, String[])
writes a select statement to get last update versions of all entities.
Declaration
public void GetLastUpdateVersionsOfEntities(string schema, string[] entities)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
| System.String[] | entities | 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.
Declaration
public void GetLatestSuccessfulSyncDateOverAllClients(string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
GetSyncPeriodInfo(String)
writes a select statement to get the sync period information.
Declaration
public void GetSyncPeriodInfo(string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
GetVersionInfo(String, ModelEntityBase)
writes a select statement to get the version information of a specific entity.
Declaration
public void GetVersionInfo(string schema, ModelEntityBase entity)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
| ModelEntityBase | entity | the target entity |
GetVersionInfoOfDead(String)
writes a select statement to get the version information of a specific dead entity.
Declaration
public void GetVersionInfoOfDead(string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
Insert(String, ModelEntityBase, StorageColumn[])
Writes an insert statement to the generation environment.
Declaration
public void Insert(string schema, ModelEntityBase entity, StorageColumn[] columns)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to write. |
| ModelEntityBase | entity | the target entity. |
| StorageColumn[] | columns | the storage columns. |
InsertDeletionDate()
writes the sync date.
Declaration
public void InsertDeletionDate()
InsertSyncDate()
writes the sync date.
Declaration
public void InsertSyncDate()
InstalledBatches(String)
Writes a select statement to get the installed batches.
Declaration
public void InstalledBatches(string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
InstalledFeatures(String)
Writes a select statement to get all installed feature uuids.
Declaration
public void InstalledFeatures(string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
IsInSchema(String)
writes a IsInSchema check
Declaration
public void IsInSchema(string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to create the sql for. |
ReadLocalizedTextValues(String, EntityObject, Culture[])
read localized text values
Declaration
public void ReadLocalizedTextValues(string schema, EntityObject entityObject, Culture[] cultures)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to create the sql for. |
| EntityObject | entityObject | the entityobject to load the localizations for. |
| Culture[] | cultures | the cultures to load for the entityobject. |
RemoveBlobsFromFetchQueueCommand(String)
wrties a delete statement to remove a specific blob uuid from the chunk fetch queue.
Declaration
public void RemoveBlobsFromFetchQueueCommand(string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
RemoveInstalledBatch(String)
Write the delete statement to remove an installed batch.
Declaration
public void RemoveInstalledBatch(string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
RemoveInstalledFeature(String)
writes a delete statement to remove an installed feature.
Declaration
public void RemoveInstalledFeature(string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
SetCurrentVersion(String)
writes an update statement to set the current version.
Declaration
public void SetCurrentVersion(string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
SetLastReceivedAnchor(String)
Writes an update statement to set the LastReceivedAnchor.
Declaration
public void SetLastReceivedAnchor(string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
SetLastSentAnchor(String)
Writes an update statement to update the LastSentAnchor.
Declaration
public void SetLastSentAnchor(string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
SetServerReplicaId(String)
writes an update statement to set the replica id.
Declaration
public void SetServerReplicaId(string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
StoreLocalizedTextValues(String, EntityObject)
store localized text values
Declaration
public void StoreLocalizedTextValues(string schema, EntityObject entityObject)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | 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.
Declaration
public void SystemTables(string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
TenantDatabaseVersion(String)
produces a select statement returning the tenant database version.
Declaration
public void TenantDatabaseVersion(string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
TransformText()
Create the template output
Declaration
public override string TransformText()
Returns
| Type | Description |
|---|---|
| System.String |
Overrides
Update(String, ModelEntityBase, StorageColumn[])
Writes an update statement to the generation environment.
Declaration
public void Update(string schema, ModelEntityBase entity, StorageColumn[] columns)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
| ModelEntityBase | entity | the target entity. |
| StorageColumn[] | columns | the storage columns. |
UpdateSyncClientLastSuccessfulUpload(String)
Update LastSuccessfulUpload within SyncClient.
Declaration
public void UpdateSyncClientLastSuccessfulUpload(string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | The schema to use. |
UpdateSyncClientLastSyncAttempt(String)
Update LastSyncAttempt within SyncClient.
Declaration
public void UpdateSyncClientLastSyncAttempt(string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | The schema to use. |
UpdateSyncClientSuccessful(String)
writes an update statement to update the last successful sync of a sync client.
Declaration
public void UpdateSyncClientSuccessful(string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
UpdateSyncClientUnSuccessful(String)
writes an update statement to update the last unsuccessful sync of a sync client.
Declaration
public void UpdateSyncClientUnSuccessful(string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
UserTables(String)
Creates a select statement returning the entities which have a User Ownership.
Declaration
public void UserTables(string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |