DataModelCmdBuilder implements an IDataModelCmdBuilder that builds database commands for IDataModel objects.
Gets or sets the command builder object.
public IDbCmdBuilder CommandBuilder { get; set; }Adds a predicate that applies the concurrency check.
protected Void AddConcurrencyPredicateIfNecessary(statement, model, timestampKind, expectedTimestamp, fields)true if the predicates where added, otherwise false.
| Name | Type | Summary |
|---|---|---|
| statement | Statement | A Statement to add the predicate to. |
| model | IDataModel | An IDataModel. |
| timestampKind | TimestampKind | Kind of timestamp to apply. |
| expectedTimestamp | DateTime | Expected timestamp. |
| fields | IDictionary<String, Field> | A dictionay of fields. |
| Type | Summary |
|---|---|
| ArgumentNullException | Thrown when statement is null. -or- When fields is null. -or- When model is null. |
Adds a predicate that filters by the identity or autonumeric field.
protected Boolean AddIdentityOrAutonumericPredicate(statement, model, fields)true if the predicates where added, otherwise false.
| Name | Type | Summary |
|---|---|---|
| statement | Statement | A Statement to add the predicate to. |
| model | IDataModel | An IDataModel. |
| fields | IDictionary<String, Field> | A dictionay of fields. |
| Type | Summary |
|---|---|
| ArgumentNullException | Thrown when statement is null. -or- When fields is null. -or- When model is null. |
Adds predicates that filters by the primary key fields.
protected Boolean AddPrimaryKeyPredicates(statement, model, fields)true if the predicates where added, otherwise false.
| Name | Type | Summary |
|---|---|---|
| statement | Statement | Statement to add the predicate to. |
| model | IDataModel | The target IDataModel. |
| fields | IDictionary<String, Field> | A dictionay of fields. |
| Type | Summary |
|---|---|
| ArgumentNullException | Thrown when statement is null. -or- When fields is null. -or- When model is null. |
Builds a SQL delete command.
public IDbCommand BuildDelete(dataService, model, timestampKind, expectedTimestamp)A delete command to be executed.
| Name | Type | Summary |
|---|---|---|
| dataService | IDataService | The data service for the model. |
| model | IDataModel | An IDataModel. |
| timestampKind | TimestampKind | Timestamp configuration. |
| expectedTimestamp | DateTime | The expected timestamp value. |
| Type | Summary |
|---|---|
| ArgumentNullException | Thrown when dataService is null. -o- When model is null. |
| MissingWhereClauseException | Thrown when the WHERE clause could not be built. |
Builds a SQL insert command.
public IDbCommand BuildInsert(dataService, model, includeIdOutputParameter)An insert command to be executed.
| Name | Type | Summary |
|---|---|---|
| dataService | IDataService | The data service for the model. |
| model | IDataModel | An IDataModel. |
| includeIdOutputParameter | Boolean | Whether the command must extract the generated Id as an output parameter. |
| Type | Summary |
|---|---|
| ArgumentNullException | Thrown when dataService is null. -o- When model is null. |
Builds a SQL update command.
public IDbCommand BuildUpdate(dataService, model, timestampKind, expectedTimestamp)An update command to be executed.
| Name | Type | Summary |
|---|---|---|
| dataService | IDataService | The data service for the model. |
| model | IDataModel | An IDataModel. |
| timestampKind | TimestampKind | Timestamp configuration. |
| expectedTimestamp | DateTime | The expected timestamp value. |
| Type | Summary |
|---|---|
| ArgumentNullException | Thrown when dataService is null. -o- When model is null. |
| MissingWhereClauseException | Thrown when the WHERE clause could not be built. |
Check if the object state is valid.
protected Void EnsureState()| Type | Summary |
|---|---|
| MissingRequiredPropertyException | Thrown when a required property is not initialized. |