Class SchemaTemplates
Class to produce the template output
Inherited Members
Namespace: TimeCockpit.Data.Database.StringTemplates
Assembly: TimeCockpit.Data.dll
Syntax
public class SchemaTemplates : SqlTransformBase
Constructors
SchemaTemplates(StringBuilder, SqlDialect)
Initializes a new instance of the SchemaTemplates class.
Declaration
public SchemaTemplates(StringBuilder generationEnvironment, SqlDialect dialect)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Text.StringBuilder | generationEnvironment | the target generation environment. |
| SqlDialect | dialect | the dialect for the template. |
SchemaTemplates(SqlDialect)
Initializes a new instance of the SchemaTemplates class.
Declaration
public SchemaTemplates(SqlDialect dialect)
Parameters
| Type | Name | Description |
|---|---|---|
| SqlDialect | dialect | 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.
Declaration
public void AddBlobColumnToGarbageCollection(string schema, ModelEntityBase entity, BinaryProperty blobProperty)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
| ModelEntityBase | entity | the model entity. |
| BinaryProperty | blobProperty | the blob property. |
CreateConstraints(ModelEntityBase, Relation[], String)
creates an sql command to create constraints.
Declaration
public void CreateConstraints(ModelEntityBase entity, Relation[] relations, string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| ModelEntityBase | entity | the entity. |
| Relation[] | relations | the relations to create constraints for. |
| System.String | schema | the schema to use. |
CreateCulture(String, TextProperty[], KeyValuePair<TextProperty, Boolean>[], Culture)
creates an sql command to create a culture.
Declaration
public void CreateCulture(string schema, TextProperty[] localizedProperties, KeyValuePair<TextProperty, bool>[] firstTimers, Culture culture)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
| TextProperty[] | localizedProperties | all localized textproperties in the model. |
| System.Collections.Generic.KeyValuePair<TextProperty, System.Boolean>[] | firstTimers | 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.
Declaration
public void CreateEntity(string schema, ModelEntityBase entity)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
| ModelEntityBase | entity | the entity to use. |
CreateEntityView(String)
creates an sql command to create an entity view.
Declaration
public void CreateEntityView(string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
CreateModelAction(String)
creates an sql command to create a model action..
Declaration
public void CreateModelAction(string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
CreateModelEntityInterface(String, ModelEntityInterface)
creates an SQL command to create a model entity interface.
Declaration
public void CreateModelEntityInterface(string schema, ModelEntityInterface entityInterface)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
| ModelEntityInterface | entityInterface | the entity interface. |
CreateNamedSetDefinition(String)
creates an sql command to create a named set definition.
Declaration
public void CreateNamedSetDefinition(string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
CreatePermission(String)
creates an sql command to drop an entity view.
Declaration
public void CreatePermission(string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
CreateProperty(String, ModelProperty, StorageColumn[], Object, Culture[])
creates an SQL command to create a property.
Declaration
public void CreateProperty(string schema, ModelProperty property, StorageColumn[] columns, object lengthPrecision, Culture[] cultures)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
| ModelProperty | property | the property to create. |
| StorageColumn[] | columns | the storage columns. |
| System.Object | lengthPrecision | the optional length precision. |
| Culture[] | cultures | the available cultures in the model. |
CreateRelation(String, RelationBase, Boolean)
creates an SQL command to create a relation.
Declaration
public void CreateRelation(string schema, RelationBase relation, bool hasLogicalRelations)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
| RelationBase | relation | the relation to create. |
| System.Boolean | hasLogicalRelations | true if the installed schema has logical relations installed, false otherwise |
CreateTrigger(String)
creates an sql command to create a trigger.
Declaration
public void CreateTrigger(string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
CreateValidationRule(String)
creates an SQL command to create a validation rule.
Declaration
public void CreateValidationRule(string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
DisableCyclicConstraints(ModelEntityBase, String)
creates an sql command to disable constraints.
Declaration
public void DisableCyclicConstraints(ModelEntityBase entity, string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| ModelEntityBase | entity | the entity. |
| System.String | schema | the schema to use. |
DropConstraints(ModelEntityBase, String)
creates an sql command to drop constraints.
Declaration
public void DropConstraints(ModelEntityBase entity, string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| ModelEntityBase | entity | the entity. |
| System.String | schema | the schema to use. |
DropCulture(String, TextProperty[], Culture)
creates an sql command to drop a culture.
Declaration
public void DropCulture(string schema, TextProperty[] localizedProperties, Culture culture)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
| TextProperty[] | localizedProperties | all localized textproperties in the model. |
| Culture | culture | the culture to remove. |
DropDefaultConstraint(String, ModelElement, StorageColumn)
creates an sql command to drop default constraint.
Declaration
public void DropDefaultConstraint(string schema, ModelElement element, StorageColumn column)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
| ModelElement | element | the model element. |
| StorageColumn | column | the storage column of concern. |
DropEntity(String, ModelEntityBase)
creates an SQL command to drop an entity.
Declaration
public void DropEntity(string schema, ModelEntityBase entity)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
| ModelEntityBase | entity | model entity base. |
DropEntityView(String)
creates an sql command to drop an entity view.
Declaration
public void DropEntityView(string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
DropModelAction(String)
creates an sql command to drop a model action.
Declaration
public void DropModelAction(string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
DropModelEntityInterface(String, DeleteOperation)
creates an sql command to drop an model entity interface.
Declaration
public void DropModelEntityInterface(string schema, DeleteOperation entity)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
| DeleteOperation | entity | the delete operation. |
DropNamedSetDefinition(String)
creates an sql command to drop a named set definition.
Declaration
public void DropNamedSetDefinition(string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
DropPermission(String)
creates an sql command to drop a permission.
Declaration
public void DropPermission(string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
DropProperty(String, DeleteOperation, StorageColumn[], ModelProperty, Culture[])
creates an SQL command to drop a property.
Declaration
public void DropProperty(string schema, DeleteOperation deleteOperation, StorageColumn[] columns, ModelProperty property, Culture[] cultures)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
| DeleteOperation | deleteOperation | the delete operation. |
| StorageColumn[] | columns | the storage columns. |
| ModelProperty | property | the property to create. |
| Culture[] | cultures | the available cultures in the model. |
DropRelation(String, DeleteOperation)
creates an SQL command to drop a relation.
Declaration
public void DropRelation(string schema, DeleteOperation deleteOperation)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
| DeleteOperation | deleteOperation | the delete operation. |
DropTrigger(String)
creates an sql command to drop a trigger.
Declaration
public void DropTrigger(string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
DropValidationRule(String)
creates an SQL command to drop a validation rule.
Declaration
public void DropValidationRule(string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
EnableCyclicConstraints(ModelEntityBase, String)
creates an sql command to enable cyclic constraints.
Declaration
public void EnableCyclicConstraints(ModelEntityBase entity, string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| ModelEntityBase | entity | the entity. |
| System.String | schema | the schema to use. |
GetExistingLocalizedColumnsByProperty(String, ModelProperty)
Gets a list of localized columns for a given property.
Declaration
public void GetExistingLocalizedColumnsByProperty(string schema, ModelProperty property)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
| ModelProperty | property | A property to check existing translations for. |
GetLocalModelVersion(String)
creates an sql command to get the local model version.
Declaration
public void GetLocalModelVersion(string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
HasColumnBeenLocalized(String, ModelProperty)
Gets a list of localized columns for a given property.
Declaration
public void HasColumnBeenLocalized(string schema, ModelProperty property)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
| ModelProperty | property | A property to check existing translations for. |
InsertIntoDead(String)
creates an sql command to insert something into a dead.
Declaration
public void InsertIntoDead(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
UpdateCulture(String)
creates an sql command to update a cultre.
Declaration
public void UpdateCulture(string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
UpdateEntity(String, ModelEntityBase)
creates an SQL command to update an entity.
Declaration
public void UpdateEntity(string schema, ModelEntityBase entity)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
| ModelEntityBase | entity | model entity base. |
UpdateEntityView(String)
creates an sql command to update an entity view.
Declaration
public void UpdateEntityView(string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
UpdateModelAction(String, Boolean, Boolean)
creates an sql command to update a model action.
Declaration
public void UpdateModelAction(string schema, bool hasShowInFormsListsExpression, bool hasExecuteWithoutPrompt)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
| System.Boolean | hasShowInFormsListsExpression | |
| System.Boolean | hasExecuteWithoutPrompt |
UpdateNamedSetDefinition(String)
creates an sql command to update a named set definition.
Declaration
public void UpdateNamedSetDefinition(string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
UpdatePermission(String)
creates an sql command to update a permission.
Declaration
public void UpdatePermission(string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
UpdateProperty(String, ModelProperty, StorageColumn[], Object, Culture[], Culture[], Culture)
creates an SQL command to update a property.
Declaration
public void UpdateProperty(string schema, ModelProperty property, StorageColumn[] columns, object lengthPrecision, Culture[] cultures, Culture[] existingCultures, Culture defaultCulture)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
| ModelProperty | property | the property to create. |
| StorageColumn[] | columns | the storage columns. |
| System.Object | lengthPrecision | the optional length precision. |
| Culture[] | cultures | the cultures missing for the given property. |
| Culture[] | existingCultures | the cultures that have already been created before. |
| Culture | defaultCulture | the current default culture of the model. |
UpdateRelation(String, RelationBase, Boolean)
creates an SQL command to update a relation.
Declaration
public void UpdateRelation(string schema, RelationBase relation, bool hasLogicalRelations)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
| RelationBase | relation | the relation to create. |
| System.Boolean | hasLogicalRelations | true if the installed schema has logical relations installed, false otherwise |
UpdateTrigger(String)
creates an sql command to update a trigger.
Declaration
public void UpdateTrigger(string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |
UpdateValidationRule(String)
creates an SQL command to update a validation rule.
Declaration
public void UpdateValidationRule(string schema)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schema | the schema to use. |