C# Class LX.EasyDb.Mapping.Table

A relational table.
Inheritance: IRelationalModel, Dapper.SqlMapper.ITypeMap
ファイルを表示 Open project: longshine/EasyDb.NET

Public Methods

Method Description
AddCheckConstraint ( String constraint ) : void

Adds a check constraint.

AddColumn ( Column column ) : void

Adds a column.

FindColumnByColumnName ( String columnName ) : Column

Finds a column by its name.

FindColumnByFieldName ( String fieldName ) : Column

Finds a column by its name.

GetFieldName ( String columnName ) : String

Gets the field name mapped with the given column.

GetOrCreateUniqueKey ( String keyName ) : UniqueKey

Gets a unique key by its name, or creates it if not found.

GetQualifiedName ( Dialect dialect, String defaultCatalog, String defaultSchema ) : String

Gets qualified name of thia table.

GetQuotedName ( Dialect dialect ) : String

Gets quoted name.

GetQuotedSchema ( Dialect dialect ) : String

Gets quoted schema.

Qualify ( String catalog, String schema, String table ) : String

Qualifies a table's name.

Table ( ) : System

Initializes an empty mapping table.

Table ( Type type, INamingStrategy namingStrategy ) : System

Initializes a mapping table.

ToSqlCreate ( Dialect dialect, String defaultCatalog, String defaultSchema ) : String

Generates SQL for creating this table.

ToSqlDelete ( Dialect dialect, String defaultCatalog, String defaultSchema ) : String

Generates SQL for deleting records in this table.

ToSqlDrop ( Dialect dialect, String defaultCatalog, String defaultSchema ) : String

Generates SQL for droping this table.

ToSqlInsert ( Dialect dialect, String defaultCatalog, String defaultSchema ) : String

Generates SQL for inserting records into this table.

ToSqlSelect ( Dialect dialect, String defaultCatalog, String defaultSchema, System.Boolean useKeys ) : String

Generates SQL for selecting records in this table.

ToSqlUpdate ( Dialect dialect, String defaultCatalog, String defaultSchema ) : String

Generates SQL for updating records in this table.

Private Methods

Method Description
CreateColumn ( MemberInfo mi, INamingStrategy namingStrategy ) : Column
LookupDbType ( Type type, String name ) : DbType
Phantom ( Type type ) : void
SqlMapper ( ) : ConstructorInfo
SqlMapper ( String names, Type types ) : ConstructorInfo

Finds best constructor.

SqlMapper ( ConstructorInfo constructor, String columnName ) : SqlMapper.IMemberMap

Gets mapping for constructor parameter.

SqlMapper ( String columnName ) : SqlMapper.IMemberMap

Gets member mapping for column.

Method Details

AddCheckConstraint() public method

Adds a check constraint.
public AddCheckConstraint ( String constraint ) : void
constraint String
return void

AddColumn() public method

Adds a column.
public AddColumn ( Column column ) : void
column Column the column to add
return void

FindColumnByColumnName() public method

Finds a column by its name.
public FindColumnByColumnName ( String columnName ) : Column
columnName String the name of the column to find
return Column

FindColumnByFieldName() public method

Finds a column by its name.
public FindColumnByFieldName ( String fieldName ) : Column
fieldName String the name of the field to find
return Column

GetFieldName() public method

Gets the field name mapped with the given column.
public GetFieldName ( String columnName ) : String
columnName String the column name
return String

GetOrCreateUniqueKey() public method

Gets a unique key by its name, or creates it if not found.
public GetOrCreateUniqueKey ( String keyName ) : UniqueKey
keyName String
return UniqueKey

GetQualifiedName() public method

Gets qualified name of thia table.
public GetQualifiedName ( Dialect dialect, String defaultCatalog, String defaultSchema ) : String
dialect Dialect
defaultCatalog String the default catalog name
defaultSchema String the default schema name
return String

GetQuotedName() public method

Gets quoted name.
public GetQuotedName ( Dialect dialect ) : String
dialect Dialect
return String

GetQuotedSchema() public method

Gets quoted schema.
public GetQuotedSchema ( Dialect dialect ) : String
dialect Dialect
return String

Qualify() public static method

Qualifies a table's name.
public static Qualify ( String catalog, String schema, String table ) : String
catalog String the catalog name
schema String the schema name
table String the table name
return String

Table() public method

Initializes an empty mapping table.
public Table ( ) : System
return System

Table() public method

Initializes a mapping table.
public Table ( Type type, INamingStrategy namingStrategy ) : System
type System.Type the type to map
namingStrategy INamingStrategy the naming strategy to apply
return System

ToSqlCreate() public method

Generates SQL for creating this table.
public ToSqlCreate ( Dialect dialect, String defaultCatalog, String defaultSchema ) : String
dialect Dialect
defaultCatalog String the default catalog name
defaultSchema String the default schema name
return String

ToSqlDelete() public method

Generates SQL for deleting records in this table.
public ToSqlDelete ( Dialect dialect, String defaultCatalog, String defaultSchema ) : String
dialect Dialect
defaultCatalog String the default catalog name
defaultSchema String the default schema name
return String

ToSqlDrop() public method

Generates SQL for droping this table.
public ToSqlDrop ( Dialect dialect, String defaultCatalog, String defaultSchema ) : String
dialect Dialect
defaultCatalog String the default catalog name
defaultSchema String the default schema name
return String

ToSqlInsert() public method

Generates SQL for inserting records into this table.
public ToSqlInsert ( Dialect dialect, String defaultCatalog, String defaultSchema ) : String
dialect Dialect
defaultCatalog String the default catalog name
defaultSchema String the default schema name
return String

ToSqlSelect() public method

Generates SQL for selecting records in this table.
public ToSqlSelect ( Dialect dialect, String defaultCatalog, String defaultSchema, System.Boolean useKeys ) : String
dialect Dialect
defaultCatalog String the default catalog name
defaultSchema String the default schema name
useKeys System.Boolean a boolean value indicating whether using primary keys as where conditions
return String

ToSqlUpdate() public method

Generates SQL for updating records in this table.
public ToSqlUpdate ( Dialect dialect, String defaultCatalog, String defaultSchema ) : String
dialect Dialect
defaultCatalog String the default catalog name
defaultSchema String the default schema name
return String