C# Class FrameDAL.Dialect.BaseDialect

Author: Vincent Lau. 数据库方言类的基类,此类实现了一些通用的方法,通过此类获得的SQL具有跨数据的特性, 因为无法确定所使用的数据库,所以此类只能生成一些通用的SQL,若想针对不同的数据库进行 定制与优化,应写一个具体的方言类继承此类或直接实现IDialect接口。
Inheritance: IDialect
Afficher le fichier Open project: vincentlauvlwj/FrameDAL

Méthodes publiques

Méthode Description
GetAddRelationSql ( PropertyInfo manyToManyProp ) : string
GetCascadeDeleteSql ( PropertyInfo oneToManyProp ) : string
GetCheckExistSql ( Type type ) : string
GetDeleteItemSql ( PropertyInfo oneToManyProp, int countLeft ) : string
GetDeleteRelationsSql ( PropertyInfo manyToManyProp ) : string
GetDeleteSql ( Type type ) : string

获得实体类对应的delete sql

GetGeneratedKeySql ( string seqName ) : string

获得一条SQL,该SQL从数据库中查询最近一次插入操作生成的主键,此方法由子类实现

GetInsertSql ( Type type ) : string

获得实体类对应的表的insert sql

GetLoadColumnPropertySql ( PropertyInfo prop ) : string
GetLoadManyToManyPropertySql ( PropertyInfo prop, bool enableLazy, string>.Dictionary &resultMap ) : string
GetLoadManyToOnePropertySql ( PropertyInfo prop, bool enableLazy, string>.Dictionary &resultMap ) : string
GetLoadOneToManyPropertySql ( PropertyInfo prop, bool enableLazy, string>.Dictionary &resultMap ) : string
GetPagingSql ( string sqlText, int firstResult, int pageSize ) : string

执行查询之前,对SQL命令进行预处理,此方法由子类实现

GetSelectSql ( Type type, bool enableLazy, string>.Dictionary &resultMap, string where = null ) : string

获得实体类对应的select sql

GetUpdateForeignKeySql ( PropertyInfo oneToManyProp, int countLeft ) : string
GetUpdateSql ( Type type ) : string

获得实体类对应的update sql

Méthodes protégées

Méthode Description
AppendSelectedColumns ( StringBuilder sb, Type type, bool enableLazy, string>.Dictionary resultMap, string prefix ) : void

Private Methods

Méthode Description
GetSelectFromPart ( PropertyInfo prop, string>.Dictionary resultMap, bool flag ) : string

Method Details

AppendSelectedColumns() protected méthode

protected AppendSelectedColumns ( StringBuilder sb, Type type, bool enableLazy, string>.Dictionary resultMap, string prefix ) : void
sb StringBuilder
type System.Type
enableLazy bool
resultMap string>.Dictionary
prefix string
Résultat void

GetAddRelationSql() public méthode

public GetAddRelationSql ( PropertyInfo manyToManyProp ) : string
manyToManyProp System.Reflection.PropertyInfo
Résultat string

GetCascadeDeleteSql() public méthode

public GetCascadeDeleteSql ( PropertyInfo oneToManyProp ) : string
oneToManyProp System.Reflection.PropertyInfo
Résultat string

GetCheckExistSql() public méthode

public GetCheckExistSql ( Type type ) : string
type System.Type
Résultat string

GetDeleteItemSql() public méthode

public GetDeleteItemSql ( PropertyInfo oneToManyProp, int countLeft ) : string
oneToManyProp System.Reflection.PropertyInfo
countLeft int
Résultat string

GetDeleteRelationsSql() public méthode

public GetDeleteRelationsSql ( PropertyInfo manyToManyProp ) : string
manyToManyProp System.Reflection.PropertyInfo
Résultat string

GetDeleteSql() public méthode

获得实体类对应的delete sql
type为null 该类没有添加Table特性,或者Table.Name属性为空或空白字符串
public GetDeleteSql ( Type type ) : string
type System.Type 实体类
Résultat string

GetGeneratedKeySql() public abstract méthode

获得一条SQL,该SQL从数据库中查询最近一次插入操作生成的主键,此方法由子类实现
public abstract GetGeneratedKeySql ( string seqName ) : string
seqName string 生成主键的序列,如果此方法的实现不需要此参数,可忽略
Résultat string

GetInsertSql() public méthode

获得实体类对应的表的insert sql
type为null 该类没有添加Table特性,或者Table.Name属性为空或空白字符串 该类中没有任何公开属性
public GetInsertSql ( Type type ) : string
type System.Type 实体类
Résultat string

GetLoadColumnPropertySql() public méthode

public GetLoadColumnPropertySql ( PropertyInfo prop ) : string
prop System.Reflection.PropertyInfo
Résultat string

GetLoadManyToManyPropertySql() public méthode

public GetLoadManyToManyPropertySql ( PropertyInfo prop, bool enableLazy, string>.Dictionary &resultMap ) : string
prop System.Reflection.PropertyInfo
enableLazy bool
resultMap string>.Dictionary
Résultat string

GetLoadManyToOnePropertySql() public méthode

public GetLoadManyToOnePropertySql ( PropertyInfo prop, bool enableLazy, string>.Dictionary &resultMap ) : string
prop System.Reflection.PropertyInfo
enableLazy bool
resultMap string>.Dictionary
Résultat string

GetLoadOneToManyPropertySql() public méthode

public GetLoadOneToManyPropertySql ( PropertyInfo prop, bool enableLazy, string>.Dictionary &resultMap ) : string
prop System.Reflection.PropertyInfo
enableLazy bool
resultMap string>.Dictionary
Résultat string

GetPagingSql() public abstract méthode

执行查询之前,对SQL命令进行预处理,此方法由子类实现
public abstract GetPagingSql ( string sqlText, int firstResult, int pageSize ) : string
sqlText string 要进行预处理的SQL
firstResult int 要返回的第一条结果的索引,该索引从0开始
pageSize int 返回的结果数量,若为0,则返回所有结果,不进行分页查询
Résultat string

GetSelectSql() public méthode

获得实体类对应的select sql
type为null 实体类映射错误
public GetSelectSql ( Type type, bool enableLazy, string>.Dictionary &resultMap, string where = null ) : string
type System.Type 实体类
enableLazy bool
resultMap string>.Dictionary
where string
Résultat string

GetUpdateForeignKeySql() public méthode

public GetUpdateForeignKeySql ( PropertyInfo oneToManyProp, int countLeft ) : string
oneToManyProp System.Reflection.PropertyInfo
countLeft int
Résultat string

GetUpdateSql() public méthode

获得实体类对应的update sql
type为null 实体类映射错误
public GetUpdateSql ( Type type ) : string
type System.Type 实体类
Résultat string