C# Class Griffin.Data.Mapper.CommandBuilders.CommandBuilder

Base class for command builders
Creates SQL commands per the SQL92 standard. Inherit this class to customize different commands.
Inheritance: ICommandBuilder
Afficher le fichier Open project: jgauffin/Griffin.Framework Class Usage Examples

Méthodes publiques

Méthode Description
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.

Method Details

CommandBuilder() public méthode

Initializes a new instance of the CommandBuilder class.
mapper
public CommandBuilder ( ICrudEntityMapper mapper ) : System
mapper ICrudEntityMapper The mapper.
Résultat System

DeleteCommand() public méthode

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
Résultat void

InsertCommand() public méthode

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
Résultat void

Paging() public méthode

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.
Résultat void

TruncateCommand() public méthode

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
Résultat void

UpdateCommand() public méthode

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
Résultat void