C# Class Signum.Engine.CodeGeneration.EntityCodeGenerator

Show file Open project: signumsoftware/framework

Public Properties

Property Type Description
CurrentSchema Schema
InverseGraph DirectedGraph
SolutionFolder string
SolutionName string
Tables DiffTable>.Dictionary

Public Methods

Method Description
GenerateEntitiesFromDatabaseTables ( ) : void

Protected Methods

Method Description
CleanDefault ( string def ) : string
DefaultColumnName ( DiffTable table, DiffColumn col ) : string
GetBackColumnNameAttribute ( DiffColumn backReference ) : string
GetEmbeddedField ( DiffTable table, DiffColumn col ) : string
GetEmbeddedTypeName ( string fieldName ) : string
GetEntityAttributes ( DiffTable table ) : IEnumerable
GetEntityBaseClass ( ObjectName objectName ) : string
GetEntityData ( DiffTable table ) : EntityData
GetEntityKind ( DiffTable table ) : EntityKind
GetEntityName ( ObjectName objectName ) : string
GetEnumAttributes ( DiffTable table ) : List
GetEnumDescription ( DiffTable table, DataRow item ) : string
GetEnumId ( DiffTable table, DataRow row ) : int
GetEnumValue ( DiffTable table, DataRow item ) : string
GetFieldAttributes ( DiffTable table, DiffColumn col, string relatedEntity ) : IEnumerable
GetFieldMListName ( DiffTable table, DiffTable relatedTable, MListInfo mListInfo ) : string
GetFieldName ( DiffTable table, DiffColumn col ) : string
GetFieldType ( DiffTable table, DiffColumn col, string relatedEntity ) : string
GetFileName ( DiffTable t ) : string
GetMListFields ( DiffTable table ) : MListInfo>>.IEnumerable
GetMListInfo ( DiffTable table ) : MListInfo
GetMListOrderColumn ( DiffTable table ) : DiffColumn
GetMListParentColumn ( DiffTable table ) : DiffColumn
GetMListTrivialElementColumn ( DiffTable table, DiffColumn parentColumn, DiffColumn orderColumn ) : DiffColumn
GetMinStringLength ( DiffColumn col ) : int?
GetNamespace ( string fileName ) : string
GetOperationName ( ObjectName objectName ) : string
GetPreserveOrderAttribute ( MListInfo mListInfo ) : string
GetPrimaryKeyAttribute ( DiffTable table ) : string
GetPrimaryKeyColumn ( DiffTable table ) : DiffColumn
GetProjectFolder ( ) : string
GetPropertyAttributes ( DiffTable table, DiffColumn col, string relatedEntity ) : IEnumerable
GetRelatedEntity ( DiffTable table, DiffColumn col ) : string
GetSolutionInfo ( string &solutionFolder, string &solutionName ) : void
GetSqlDbTypeParts ( DiffColumn col, Type type ) : List
GetSqlTypeAttribute ( DiffTable table, DiffColumn col ) : string
GetStringLengthValidator ( DiffTable table, DiffColumn col, string relatedEntity ) : string
GetTableNameAttribute ( ObjectName objectName, MListInfo mListInfo ) : string
GetTables ( ) : List
GetTicksColumnAttribute ( DiffTable table ) : string
GetToStringColumn ( DiffTable table ) : DiffColumn
GetUsingNamespaces ( string fileName, IEnumerable tables ) : List
GetValueType ( DiffColumn col ) : Type
HasNotNullableAttribute ( DiffColumn col, string relatedEntity ) : bool
HasUniqueIndex ( DiffTable table, DiffColumn col ) : bool
IsEnum ( ObjectName objectName ) : bool
IsLite ( DiffTable table, DiffColumn col ) : bool
IsReadonly ( DiffTable table, DiffColumn col ) : bool
RequiresColumnName ( DiffTable table, DiffColumn col ) : bool
WriteAttributeTag ( StringBuilder sb, IEnumerable attributes ) : void
WriteEmbeddedEntity ( string fileName, DiffTable table, string name, List columns ) : string
WriteEmbeddedField ( DiffTable table, string fieldName ) : string
WriteEntity ( string fileName, DiffTable table ) : string
WriteEnum ( DiffTable table ) : string
WriteField ( string fileName, DiffTable table, DiffColumn col ) : string
WriteFieldMList ( string fileName, DiffTable table, MListInfo mListInfo, DiffTable relatedTable ) : string
WriteFile ( string fileName, IEnumerable tables ) : string
WriteMultiColumnIndexComment ( DiffTable table, string name, IEnumerable columns ) : string
WriteOperations ( DiffTable table ) : string
WriteTableEntity ( string fileName, DiffTable table ) : string
WriteToString ( DiffTable table ) : string

Method Details

CleanDefault() protected method

protected CleanDefault ( string def ) : string
def string
return string

DefaultColumnName() protected method

protected DefaultColumnName ( DiffTable table, DiffColumn col ) : string
table DiffTable
col DiffColumn
return string

GenerateEntitiesFromDatabaseTables() public method

public GenerateEntitiesFromDatabaseTables ( ) : void
return void

GetBackColumnNameAttribute() protected method

protected GetBackColumnNameAttribute ( DiffColumn backReference ) : string
backReference DiffColumn
return string

GetEmbeddedField() protected method

protected GetEmbeddedField ( DiffTable table, DiffColumn col ) : string
table DiffTable
col DiffColumn
return string

GetEmbeddedTypeName() protected method

protected GetEmbeddedTypeName ( string fieldName ) : string
fieldName string
return string

GetEntityAttributes() protected method

protected GetEntityAttributes ( DiffTable table ) : IEnumerable
table DiffTable
return IEnumerable

GetEntityBaseClass() protected method

protected GetEntityBaseClass ( ObjectName objectName ) : string
objectName ObjectName
return string

GetEntityData() protected method

protected GetEntityData ( DiffTable table ) : EntityData
table DiffTable
return EntityData

GetEntityKind() protected method

protected GetEntityKind ( DiffTable table ) : EntityKind
table DiffTable
return EntityKind

GetEntityName() protected method

protected GetEntityName ( ObjectName objectName ) : string
objectName ObjectName
return string

GetEnumAttributes() protected method

protected GetEnumAttributes ( DiffTable table ) : List
table DiffTable
return List

GetEnumDescription() protected method

protected GetEnumDescription ( DiffTable table, DataRow item ) : string
table DiffTable
item System.Data.DataRow
return string

GetEnumId() protected method

protected GetEnumId ( DiffTable table, DataRow row ) : int
table DiffTable
row System.Data.DataRow
return int

GetEnumValue() protected method

protected GetEnumValue ( DiffTable table, DataRow item ) : string
table DiffTable
item System.Data.DataRow
return string

GetFieldAttributes() protected method

protected GetFieldAttributes ( DiffTable table, DiffColumn col, string relatedEntity ) : IEnumerable
table DiffTable
col DiffColumn
relatedEntity string
return IEnumerable

GetFieldMListName() protected method

protected GetFieldMListName ( DiffTable table, DiffTable relatedTable, MListInfo mListInfo ) : string
table DiffTable
relatedTable DiffTable
mListInfo MListInfo
return string

GetFieldName() protected method

protected GetFieldName ( DiffTable table, DiffColumn col ) : string
table DiffTable
col DiffColumn
return string

GetFieldType() protected method

protected GetFieldType ( DiffTable table, DiffColumn col, string relatedEntity ) : string
table DiffTable
col DiffColumn
relatedEntity string
return string

GetFileName() protected method

protected GetFileName ( DiffTable t ) : string
t DiffTable
return string

GetMListFields() protected method

protected GetMListFields ( DiffTable table ) : MListInfo>>.IEnumerable
table DiffTable
return MListInfo>>.IEnumerable

GetMListInfo() protected method

protected GetMListInfo ( DiffTable table ) : MListInfo
table DiffTable
return MListInfo

GetMListOrderColumn() protected method

protected GetMListOrderColumn ( DiffTable table ) : DiffColumn
table DiffTable
return DiffColumn

GetMListParentColumn() protected method

protected GetMListParentColumn ( DiffTable table ) : DiffColumn
table DiffTable
return DiffColumn

GetMListTrivialElementColumn() protected method

protected GetMListTrivialElementColumn ( DiffTable table, DiffColumn parentColumn, DiffColumn orderColumn ) : DiffColumn
table DiffTable
parentColumn DiffColumn
orderColumn DiffColumn
return DiffColumn

GetMinStringLength() protected method

protected GetMinStringLength ( DiffColumn col ) : int?
col DiffColumn
return int?

GetNamespace() protected method

protected GetNamespace ( string fileName ) : string
fileName string
return string

GetOperationName() protected method

protected GetOperationName ( ObjectName objectName ) : string
objectName ObjectName
return string

GetPreserveOrderAttribute() protected method

protected GetPreserveOrderAttribute ( MListInfo mListInfo ) : string
mListInfo MListInfo
return string

GetPrimaryKeyAttribute() protected method

protected GetPrimaryKeyAttribute ( DiffTable table ) : string
table DiffTable
return string

GetPrimaryKeyColumn() protected method

protected GetPrimaryKeyColumn ( DiffTable table ) : DiffColumn
table DiffTable
return DiffColumn

GetProjectFolder() protected method

protected GetProjectFolder ( ) : string
return string

GetPropertyAttributes() protected method

protected GetPropertyAttributes ( DiffTable table, DiffColumn col, string relatedEntity ) : IEnumerable
table DiffTable
col DiffColumn
relatedEntity string
return IEnumerable

GetRelatedEntity() protected method

protected GetRelatedEntity ( DiffTable table, DiffColumn col ) : string
table DiffTable
col DiffColumn
return string

GetSolutionInfo() protected method

protected GetSolutionInfo ( string &solutionFolder, string &solutionName ) : void
solutionFolder string
solutionName string
return void

GetSqlDbTypeParts() protected method

protected GetSqlDbTypeParts ( DiffColumn col, Type type ) : List
col DiffColumn
type System.Type
return List

GetSqlTypeAttribute() protected method

protected GetSqlTypeAttribute ( DiffTable table, DiffColumn col ) : string
table DiffTable
col DiffColumn
return string

GetStringLengthValidator() protected method

protected GetStringLengthValidator ( DiffTable table, DiffColumn col, string relatedEntity ) : string
table DiffTable
col DiffColumn
relatedEntity string
return string

GetTableNameAttribute() protected method

protected GetTableNameAttribute ( ObjectName objectName, MListInfo mListInfo ) : string
objectName ObjectName
mListInfo MListInfo
return string

GetTables() protected method

protected GetTables ( ) : List
return List

GetTicksColumnAttribute() protected method

protected GetTicksColumnAttribute ( DiffTable table ) : string
table DiffTable
return string

GetToStringColumn() protected method

protected GetToStringColumn ( DiffTable table ) : DiffColumn
table DiffTable
return DiffColumn

GetUsingNamespaces() protected method

protected GetUsingNamespaces ( string fileName, IEnumerable tables ) : List
fileName string
tables IEnumerable
return List

GetValueType() protected method

protected GetValueType ( DiffColumn col ) : Type
col DiffColumn
return System.Type

HasNotNullableAttribute() protected method

protected HasNotNullableAttribute ( DiffColumn col, string relatedEntity ) : bool
col DiffColumn
relatedEntity string
return bool

HasUniqueIndex() protected method

protected HasUniqueIndex ( DiffTable table, DiffColumn col ) : bool
table DiffTable
col DiffColumn
return bool

IsEnum() protected method

protected IsEnum ( ObjectName objectName ) : bool
objectName ObjectName
return bool

IsLite() protected method

protected IsLite ( DiffTable table, DiffColumn col ) : bool
table DiffTable
col DiffColumn
return bool

IsReadonly() protected method

protected IsReadonly ( DiffTable table, DiffColumn col ) : bool
table DiffTable
col DiffColumn
return bool

RequiresColumnName() protected method

protected RequiresColumnName ( DiffTable table, DiffColumn col ) : bool
table DiffTable
col DiffColumn
return bool

WriteAttributeTag() protected method

protected WriteAttributeTag ( StringBuilder sb, IEnumerable attributes ) : void
sb StringBuilder
attributes IEnumerable
return void

WriteEmbeddedEntity() protected method

protected WriteEmbeddedEntity ( string fileName, DiffTable table, string name, List columns ) : string
fileName string
table DiffTable
name string
columns List
return string

WriteEmbeddedField() protected method

protected WriteEmbeddedField ( DiffTable table, string fieldName ) : string
table DiffTable
fieldName string
return string

WriteEntity() protected method

protected WriteEntity ( string fileName, DiffTable table ) : string
fileName string
table DiffTable
return string

WriteEnum() protected method

protected WriteEnum ( DiffTable table ) : string
table DiffTable
return string

WriteField() protected method

protected WriteField ( string fileName, DiffTable table, DiffColumn col ) : string
fileName string
table DiffTable
col DiffColumn
return string

WriteFieldMList() protected method

protected WriteFieldMList ( string fileName, DiffTable table, MListInfo mListInfo, DiffTable relatedTable ) : string
fileName string
table DiffTable
mListInfo MListInfo
relatedTable DiffTable
return string

WriteFile() protected method

protected WriteFile ( string fileName, IEnumerable tables ) : string
fileName string
tables IEnumerable
return string

WriteMultiColumnIndexComment() protected method

protected WriteMultiColumnIndexComment ( DiffTable table, string name, IEnumerable columns ) : string
table DiffTable
name string
columns IEnumerable
return string

WriteOperations() protected method

protected WriteOperations ( DiffTable table ) : string
table DiffTable
return string

WriteTableEntity() protected method

protected WriteTableEntity ( string fileName, DiffTable table ) : string
fileName string
table DiffTable
return string

WriteToString() protected method

protected WriteToString ( DiffTable table ) : string
table DiffTable
return string

Property Details

CurrentSchema public property

public Schema CurrentSchema
return Schema

InverseGraph public property

public DirectedGraph InverseGraph
return DirectedGraph

SolutionFolder public property

public string SolutionFolder
return string

SolutionName public property

public string SolutionName
return string

Tables public property

public Dictionary Tables
return DiffTable>.Dictionary