C# 클래스 Griffin.Data.Mapper.CommandBuilders.CommandBuilder

Base class for command builders
Creates SQL commands per the SQL92 standard. Inherit this class to customize different commands.
상속: ICommandBuilder
파일 보기 프로젝트 열기: jgauffin/Griffin.Framework 1 사용 예제들

공개 메소드들

메소드 설명
CommandBuilder ( ICrudEntityMapper mapper ) : System

Initializes a new instance of the CommandBuilder class.

DeleteCommand ( IDbCommand command, object entity ) : void

Modifies the command to execute a DELETE statement

InsertCommand ( IDbCommand command, object entity ) : void

Generate an insert command, should end with a command that returns the insert identity.

Paging ( IDbCommand command, int pageNumber, int pageSize ) : void

Modify SQL statement so that the result is paged.

TruncateCommand ( IDbCommand command ) : void

Truncate all rows in a table

Will do a DELETE statement

UpdateCommand ( IDbCommand command, object entity ) : void

Create an update query from the entity.

메소드 상세

CommandBuilder() 공개 메소드

Initializes a new instance of the CommandBuilder class.
mapper
public CommandBuilder ( ICrudEntityMapper mapper ) : System
mapper ICrudEntityMapper The mapper.
리턴 System

DeleteCommand() 공개 메소드

Modifies the command to execute a DELETE statement
/// command /// or /// entity ///
public DeleteCommand ( IDbCommand command, object entity ) : void
command IDbCommand Command that will be executed after this method call
entity object Only primary key properties are used in the WHERE clause
리턴 void

InsertCommand() 공개 메소드

Generate an insert command, should end with a command that returns the insert identity.
/// command /// or /// entity /// No values were added to the query for + entity
public InsertCommand ( IDbCommand command, object entity ) : void
command IDbCommand Command to add the query to
entity object Entity to store
리턴 void

Paging() 공개 메소드

Modify SQL statement so that the result is paged.
public Paging ( IDbCommand command, int pageNumber, int pageSize ) : void
command IDbCommand Command to modify
pageNumber int One based index
pageSize int Items per page.
리턴 void

TruncateCommand() 공개 메소드

Truncate all rows in a table
Will do a DELETE statement
command
public TruncateCommand ( IDbCommand command ) : void
command IDbCommand Command that will be executed after this method call
리턴 void

UpdateCommand() 공개 메소드

Create an update query from the entity.
/// command /// or /// entity /// /// At least one property (other than primary keys) must be specified. /// or ///
public UpdateCommand ( IDbCommand command, object entity ) : void
command IDbCommand Command to modify
entity object Entity to update
리턴 void