Table of Contents

Class SchemaTemplates

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

Class to produce the template output

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

Constructors

SchemaTemplates(StringBuilder, SqlDialect)

Initializes a new instance of the SchemaTemplates class.

public SchemaTemplates(StringBuilder generationEnvironment, SqlDialect dialect)

Parameters

generationEnvironment StringBuilder

the target generation environment.

dialect SqlDialect

the dialect for the template.

SchemaTemplates(SqlDialect)

Initializes a new instance of the SchemaTemplates class.

public SchemaTemplates(SqlDialect dialect)

Parameters

dialect SqlDialect

the dialect to ue for the template.

Methods

AddBlobColumnToGarbageCollection(String, ModelEntityBase, BinaryProperty)

creates an sql command to add a blob column to the garbage collection.

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

Parameters

schema String

the schema to use.

entity ModelEntityBase

the model entity.

blobProperty BinaryProperty

the blob property.

CreateConstraints(ModelEntityBase, Relation[], String)

creates an sql command to create constraints.

public void CreateConstraints(ModelEntityBase entity, Relation[] relations, string schema)

Parameters

entity ModelEntityBase

the entity.

relations Relation[]

the relations to create constraints for.

schema String

the schema to use.

CreateCulture(String, TextProperty[], KeyValuePair<TextProperty, Boolean>[], Culture)

creates an sql command to create a culture.

public void CreateCulture(string schema, TextProperty[] localizedProperties, KeyValuePair<TextProperty, bool>[] firstTimers, Culture culture)

Parameters

schema String

the schema to use.

localizedProperties TextProperty[]

all localized textproperties in the model.

firstTimers KeyValuePair<TextProperty, Boolean>[]

the localized properties that get their first culture.

culture Culture

the culture to add.

CreateEntity(String, ModelEntityBase)

creates an SQL command to create an entity.

public void CreateEntity(string schema, ModelEntityBase entity)

Parameters

schema String

the schema to use.

entity ModelEntityBase

the entity to use.

CreateEntityView(String)

creates an sql command to create an entity view.

public void CreateEntityView(string schema)

Parameters

schema String

the schema to use.

CreateModelAction(String)

creates an sql command to create a model action..

public void CreateModelAction(string schema)

Parameters

schema String

the schema to use.

CreateModelEntityInterface(String, ModelEntityInterface)

creates an SQL command to create a model entity interface.

public void CreateModelEntityInterface(string schema, ModelEntityInterface entityInterface)

Parameters

schema String

the schema to use.

entityInterface ModelEntityInterface

the entity interface.

CreateNamedSetDefinition(String)

creates an sql command to create a named set definition.

public void CreateNamedSetDefinition(string schema)

Parameters

schema String

the schema to use.

CreatePermission(String)

creates an sql command to drop an entity view.

public void CreatePermission(string schema)

Parameters

schema String

the schema to use.

CreateProperty(String, ModelProperty, StorageColumn[], Object, Culture[])

creates an SQL command to create a property.

public void CreateProperty(string schema, ModelProperty property, StorageColumn[] columns, object lengthPrecision, Culture[] cultures)

Parameters

schema String

the schema to use.

property ModelProperty

the property to create.

columns StorageColumn[]

the storage columns.

lengthPrecision Object

the optional length precision.

cultures Culture[]

the available cultures in the model.

CreateRelation(String, RelationBase, Boolean)

creates an SQL command to create a relation.

public void CreateRelation(string schema, RelationBase relation, bool hasLogicalRelations)

Parameters

schema String

the schema to use.

relation RelationBase

the relation to create.

hasLogicalRelations Boolean

true if the installed schema has logical relations installed, false otherwise

CreateTrigger(String)

creates an sql command to create a trigger.

public void CreateTrigger(string schema)

Parameters

schema String

the schema to use.

CreateValidationRule(String)

creates an SQL command to create a validation rule.

public void CreateValidationRule(string schema)

Parameters

schema String

the schema to use.

DisableCyclicConstraints(ModelEntityBase, String)

creates an sql command to disable constraints.

public void DisableCyclicConstraints(ModelEntityBase entity, string schema)

Parameters

entity ModelEntityBase

the entity.

schema String

the schema to use.

DropConstraints(ModelEntityBase, String)

creates an sql command to drop constraints.

public void DropConstraints(ModelEntityBase entity, string schema)

Parameters

entity ModelEntityBase

the entity.

schema String

the schema to use.

DropCulture(String, TextProperty[], Culture)

creates an sql command to drop a culture.

public void DropCulture(string schema, TextProperty[] localizedProperties, Culture culture)

Parameters

schema String

the schema to use.

localizedProperties TextProperty[]

all localized textproperties in the model.

culture Culture

the culture to remove.

DropDefaultConstraint(String, ModelElement, StorageColumn)

creates an sql command to drop default constraint.

public void DropDefaultConstraint(string schema, ModelElement element, StorageColumn column)

Parameters

schema String

the schema to use.

element ModelElement

the model element.

column StorageColumn

the storage column of concern.

DropEntity(String, ModelEntityBase)

creates an SQL command to drop an entity.

public void DropEntity(string schema, ModelEntityBase entity)

Parameters

schema String

the schema to use.

entity ModelEntityBase

model entity base.

DropEntityView(String)

creates an sql command to drop an entity view.

public void DropEntityView(string schema)

Parameters

schema String

the schema to use.

DropModelAction(String)

creates an sql command to drop a model action.

public void DropModelAction(string schema)

Parameters

schema String

the schema to use.

DropModelEntityInterface(String, DeleteOperation)

creates an sql command to drop an model entity interface.

public void DropModelEntityInterface(string schema, DeleteOperation entity)

Parameters

schema String

the schema to use.

entity DeleteOperation

the delete operation.

DropNamedSetDefinition(String)

creates an sql command to drop a named set definition.

public void DropNamedSetDefinition(string schema)

Parameters

schema String

the schema to use.

DropPermission(String)

creates an sql command to drop a permission.

public void DropPermission(string schema)

Parameters

schema String

the schema to use.

DropProperty(String, DeleteOperation, StorageColumn[], ModelProperty, Culture[])

creates an SQL command to drop a property.

public void DropProperty(string schema, DeleteOperation deleteOperation, StorageColumn[] columns, ModelProperty property, Culture[] cultures)

Parameters

schema String

the schema to use.

deleteOperation DeleteOperation

the delete operation.

columns StorageColumn[]

the storage columns.

property ModelProperty

the property to create.

cultures Culture[]

the available cultures in the model.

DropRelation(String, DeleteOperation)

creates an SQL command to drop a relation.

public void DropRelation(string schema, DeleteOperation deleteOperation)

Parameters

schema String

the schema to use.

deleteOperation DeleteOperation

the delete operation.

DropTrigger(String)

creates an sql command to drop a trigger.

public void DropTrigger(string schema)

Parameters

schema String

the schema to use.

DropValidationRule(String)

creates an SQL command to drop a validation rule.

public void DropValidationRule(string schema)

Parameters

schema String

the schema to use.

EnableCyclicConstraints(ModelEntityBase, String)

creates an sql command to enable cyclic constraints.

public void EnableCyclicConstraints(ModelEntityBase entity, string schema)

Parameters

entity ModelEntityBase

the entity.

schema String

the schema to use.

GetExistingLocalizedColumnsByProperty(String, ModelProperty)

Gets a list of localized columns for a given property.

public void GetExistingLocalizedColumnsByProperty(string schema, ModelProperty property)

Parameters

schema String

the schema to use.

property ModelProperty

A property to check existing translations for.

GetLocalModelVersion(String)

creates an sql command to get the local model version.

public void GetLocalModelVersion(string schema)

Parameters

schema String

the schema to use.

HasColumnBeenLocalized(String, ModelProperty)

Gets a list of localized columns for a given property.

public void HasColumnBeenLocalized(string schema, ModelProperty property)

Parameters

schema String

the schema to use.

property ModelProperty

A property to check existing translations for.

InsertIntoDead(String)

creates an sql command to insert something into a dead.

public void InsertIntoDead(string schema)

Parameters

schema String

the schema to use.

TransformText()

Create the template output

public override string TransformText()

Returns

String

UpdateCulture(String)

creates an sql command to update a cultre.

public void UpdateCulture(string schema)

Parameters

schema String

the schema to use.

UpdateEntity(String, ModelEntityBase)

creates an SQL command to update an entity.

public void UpdateEntity(string schema, ModelEntityBase entity)

Parameters

schema String

the schema to use.

entity ModelEntityBase

model entity base.

UpdateEntityView(String)

creates an sql command to update an entity view.

public void UpdateEntityView(string schema)

Parameters

schema String

the schema to use.

UpdateModelAction(String, Boolean, Boolean)

creates an sql command to update a model action.

public void UpdateModelAction(string schema, bool hasShowInFormsListsExpression, bool hasExecuteWithoutPrompt)

Parameters

schema String

the schema to use.

hasShowInFormsListsExpression Boolean
hasExecuteWithoutPrompt Boolean

UpdateNamedSetDefinition(String)

creates an sql command to update a named set definition.

public void UpdateNamedSetDefinition(string schema)

Parameters

schema String

the schema to use.

UpdatePermission(String)

creates an sql command to update a permission.

public void UpdatePermission(string schema)

Parameters

schema String

the schema to use.

UpdateProperty(String, ModelProperty, StorageColumn[], Object, Culture[], Culture[], Culture)

creates an SQL command to update a property.

public void UpdateProperty(string schema, ModelProperty property, StorageColumn[] columns, object lengthPrecision, Culture[] cultures, Culture[] existingCultures, Culture defaultCulture)

Parameters

schema String

the schema to use.

property ModelProperty

the property to create.

columns StorageColumn[]

the storage columns.

lengthPrecision Object

the optional length precision.

cultures Culture[]

the cultures missing for the given property.

existingCultures Culture[]

the cultures that have already been created before.

defaultCulture Culture

the current default culture of the model.

UpdateRelation(String, RelationBase, Boolean)

creates an SQL command to update a relation.

public void UpdateRelation(string schema, RelationBase relation, bool hasLogicalRelations)

Parameters

schema String

the schema to use.

relation RelationBase

the relation to create.

hasLogicalRelations Boolean

true if the installed schema has logical relations installed, false otherwise

UpdateTrigger(String)

creates an sql command to update a trigger.

public void UpdateTrigger(string schema)

Parameters

schema String

the schema to use.

UpdateValidationRule(String)

creates an SQL command to update a validation rule.

public void UpdateValidationRule(string schema)

Parameters

schema String

the schema to use.