Class DataTemplates
- Assembly
- TimeCockpit.Data.dll
Class to produce the template output
public class DataTemplates : SqlTransformBase
- Inheritance
-
ObjectDataTemplates
- 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
generationEnvironmentStringBuilderthe target stringbuilder to write to.
dialectSqlDialectthe SQL dialect.
DataTemplates(SqlDialect)
Initializes a new instnace of the DataTemplates class.
public DataTemplates(SqlDialect dialect)
Parameters
dialectSqlDialectthe 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
schemaStringthe schema to use.
entityModelEntityBasethe target entity
blobPropertyBinaryPropertythe 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
schemaStringthe schema to use.
entityModelEntityBasethe target model entity
blobPropertyBinaryPropertythe propert to write for.
newBlobGuidObjecta 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
schemaStringthe schema to use.
AddInstalledBatch(String)
Writes an insert statement to add a new installed batch.
public void AddInstalledBatch(string schema)
Parameters
schemaStringthe schema to use.
AddInstalledFeature(String)
writes an insert statement to add an installed feature.
public void AddInstalledFeature(string schema)
Parameters
schemaStringthe 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
schemaStringthe schema to use.
CheckInstallBatchTableInstalled(String)
Writes a select statement to check whether the table 'SYS_InstalledBatch' is available.
public void CheckInstallBatchTableInstalled(string schema)
Parameters
schemaStringthe schema to use.
CleanupGraveyard(String, Boolean)
writes a delete from statement to do a graveyard cleanup
public void CleanupGraveyard(string schema, bool serverGeneratedTime)
Parameters
schemaStringthe schema to create the sql for.
serverGeneratedTimeBoolean
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
schemaStringthe schema to use.
entityModelEntityBasethe target entity.
relationDependencyPathIEnumerable<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
schemaStringthe schema to use.
entityModelEntityBasethe 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
schemaStringthe schema to use.
itDependencyHierarchythe dependency hierarchy.
DetachClient(String)
writes an update statement to remove a sync client.
public void DetachClient(string schema)
Parameters
schemaStringthe 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
schemaStringthe schema to use.
commandStringthe command to execute.
isSyncedBooleanif synced, the current version is increased by one with an update lock.
transactionActiveBooleanIndicates 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
schemaStringthe schema to use.
GetBlobsFromFetchQueueCommand(String)
wrties a select statement to fetch the blobs from the chunk fetch queue.
public void GetBlobsFromFetchQueueCommand(string schema)
Parameters
schemaStringthe schema to use.
GetCurrentVersion(String)
Writes a select statement to get the current version.
public void GetCurrentVersion(string schema)
Parameters
schemaStringthe schema to use.
GetDeprecatedSyncClient(String)
writes a select statement to get the deprecated sync clients.
public void GetDeprecatedSyncClient(string schema)
Parameters
schemaStringthe schema to use.
GetGarbageBlobs(String)
writes a select statement to get the top 100 next garbage blobs.
public void GetGarbageBlobs(string schema)
Parameters
schemaStringthe schema to use.
GetLastReceivedAnchor(String)
Writes a select statement to get the LastReceived anchor.
public void GetLastReceivedAnchor(string schema)
Parameters
schemaStringthe schema to use.
GetLastSentAnchor(String)
Writes a select statement to Get the LastSentAnchor.
public void GetLastSentAnchor(string schema)
Parameters
schemaStringthe 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
schemaStringthe schema to use.
entitiesString[]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
schemaStringthe schema to use.
GetSyncPeriodInfo(String)
writes a select statement to get the sync period information.
public void GetSyncPeriodInfo(string schema)
Parameters
schemaStringthe 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
schemaStringthe schema to use.
entityModelEntityBasethe target entity
GetVersionInfoOfDead(String)
writes a select statement to get the version information of a specific dead entity.
public void GetVersionInfoOfDead(string schema)
Parameters
schemaStringthe 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
schemaStringthe schema to write.
entityModelEntityBasethe target entity.
columnsStorageColumn[]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
schemaStringthe schema to use.
InstalledFeatures(String)
Writes a select statement to get all installed feature uuids.
public void InstalledFeatures(string schema)
Parameters
schemaStringthe schema to use.
IsInSchema(String)
writes a IsInSchema check
public void IsInSchema(string schema)
Parameters
schemaStringthe schema to create the sql for.
ReadLocalizedTextValues(String, EntityObject, Culture[])
read localized text values
public void ReadLocalizedTextValues(string schema, EntityObject entityObject, Culture[] cultures)
Parameters
schemaStringthe schema to create the sql for.
entityObjectEntityObjectthe entityobject to load the localizations for.
culturesCulture[]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
schemaStringthe schema to use.
RemoveInstalledBatch(String)
Write the delete statement to remove an installed batch.
public void RemoveInstalledBatch(string schema)
Parameters
schemaStringthe schema to use.
RemoveInstalledFeature(String)
writes a delete statement to remove an installed feature.
public void RemoveInstalledFeature(string schema)
Parameters
schemaStringthe schema to use.
SetCurrentVersion(String)
writes an update statement to set the current version.
public void SetCurrentVersion(string schema)
Parameters
schemaStringthe schema to use.
SetLastReceivedAnchor(String)
Writes an update statement to set the LastReceivedAnchor.
public void SetLastReceivedAnchor(string schema)
Parameters
schemaStringthe schema to use.
SetLastSentAnchor(String)
Writes an update statement to update the LastSentAnchor.
public void SetLastSentAnchor(string schema)
Parameters
schemaStringthe schema to use.
SetServerReplicaId(String)
writes an update statement to set the replica id.
public void SetServerReplicaId(string schema)
Parameters
schemaStringthe schema to use.
StoreLocalizedTextValues(String, EntityObject)
store localized text values
public void StoreLocalizedTextValues(string schema, EntityObject entityObject)
Parameters
schemaStringthe schema to create the sql for.
entityObjectEntityObjectthe 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
schemaStringthe schema to use.
TenantDatabaseVersion(String)
produces a select statement returning the tenant database version.
public void TenantDatabaseVersion(string schema)
Parameters
schemaStringthe 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
schemaStringthe schema to use.
entityModelEntityBasethe target entity.
columnsStorageColumn[]the storage columns.
UpdateSyncClientLastSuccessfulUpload(String)
Update LastSuccessfulUpload within SyncClient.
public void UpdateSyncClientLastSuccessfulUpload(string schema)
Parameters
schemaStringThe schema to use.
UpdateSyncClientLastSyncAttempt(String)
Update LastSyncAttempt within SyncClient.
public void UpdateSyncClientLastSyncAttempt(string schema)
Parameters
schemaStringThe 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
schemaStringthe 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
schemaStringthe schema to use.
UserTables(String)
Creates a select statement returning the entities which have a User Ownership.
public void UserTables(string schema)
Parameters
schemaStringthe schema to use.