C# Class NLite.Data.Schema.Script.Generator.DatabaseScriptGenerator

数据库脚本生成器,提供数据库、表、主键约束、外键约束、检查约束、Uniqule约束等脚本的创建工作
Inheritance: IDatabaseScriptGenerator
Afficher le fichier Open project: netcasewqs/elinq

Méthodes publiques

Méthode Description
Build ( IDialect dialect, Mapping mappings, string databaseName ) : DatabaseScriptEntry

生成数据库脚本

DatabaseScriptGenerator ( ) : System
GetDbType ( SqlType sqlType ) : string

得到对应的数据库类型

Méthodes protégées

Méthode Description
BuildCheckConstraintScript ( IMemberMapping member ) : string

构建特定映射对应的检查约束脚本

BuildDatabaseScript ( string databaseName ) : string

构建数据库脚本

BuildFKScript ( IMemberMapping member ) : string

构建特定映射对应的外键脚本

BuildPKScript ( IMemberMapping members ) : string

构建特定映射对应的主键脚本

BuildSchemaScript ( IEntityMapping mappings ) : string[]

构建Schema脚本

BuildSequenceScript ( Mapping mapping ) : string

构建序列脚本

BuildTableScript ( IEntityMapping mapping ) : string

构建建表脚本

BuildUniquleConstraintScript ( IMemberMapping member ) : string

构建特定映射对应的唯一性约束脚本

GetDefaultValue ( IMemberMapping f, SqlType sqlType ) : string

得到缺省值

GetTableName ( IEntityMapping mapping ) : string

得到表名

RegisterColumnType ( DBType code, int size, string name ) : void
RegisterColumnType ( DBType code, string name ) : void
RegisterColumnTypes ( ) : void

Private Methods

Méthode Description
BuildAllSequanceScripts ( IEntityMapping Mappings ) : string[]
BuildColumn ( StringBuilder sb, IMemberMapping f ) : void

Method Details

Build() public méthode

生成数据库脚本
public Build ( IDialect dialect, Mapping mappings, string databaseName ) : DatabaseScriptEntry
dialect IDialect 数据库方言
mappings Mapping 映射元数据
databaseName string
Résultat DatabaseScriptEntry

BuildCheckConstraintScript() protected méthode

构建特定映射对应的检查约束脚本
protected BuildCheckConstraintScript ( IMemberMapping member ) : string
member IMemberMapping
Résultat string

BuildDatabaseScript() protected méthode

构建数据库脚本
protected BuildDatabaseScript ( string databaseName ) : string
databaseName string
Résultat string

BuildFKScript() protected méthode

构建特定映射对应的外键脚本
protected BuildFKScript ( IMemberMapping member ) : string
member IMemberMapping
Résultat string

BuildPKScript() protected méthode

构建特定映射对应的主键脚本
protected BuildPKScript ( IMemberMapping members ) : string
members IMemberMapping
Résultat string

BuildSchemaScript() protected méthode

构建Schema脚本
protected BuildSchemaScript ( IEntityMapping mappings ) : string[]
mappings IEntityMapping
Résultat string[]

BuildSequenceScript() protected méthode

构建序列脚本
protected BuildSequenceScript ( Mapping mapping ) : string
mapping Mapping
Résultat string

BuildTableScript() protected méthode

构建建表脚本
protected BuildTableScript ( IEntityMapping mapping ) : string
mapping IEntityMapping
Résultat string

BuildUniquleConstraintScript() protected méthode

构建特定映射对应的唯一性约束脚本
protected BuildUniquleConstraintScript ( IMemberMapping member ) : string
member IMemberMapping
Résultat string

DatabaseScriptGenerator() public méthode

public DatabaseScriptGenerator ( ) : System
Résultat System

GetDbType() public méthode

得到对应的数据库类型
public GetDbType ( SqlType sqlType ) : string
sqlType NLite.Data.Common.SqlType
Résultat string

GetDefaultValue() protected méthode

得到缺省值
protected GetDefaultValue ( IMemberMapping f, SqlType sqlType ) : string
f IMemberMapping
sqlType NLite.Data.Common.SqlType
Résultat string

GetTableName() protected méthode

得到表名
protected GetTableName ( IEntityMapping mapping ) : string
mapping IEntityMapping
Résultat string

RegisterColumnType() protected méthode

protected RegisterColumnType ( DBType code, int size, string name ) : void
code DBType
size int
name string
Résultat void

RegisterColumnType() protected méthode

protected RegisterColumnType ( DBType code, string name ) : void
code DBType
name string
Résultat void

RegisterColumnTypes() protected méthode

protected RegisterColumnTypes ( ) : void
Résultat void