Property | Type | Description | |
---|---|---|---|
_coerceableTypes | TypeCoercionDelegate>.Dictionary | ||
_connDesc | IConnectionDescriptor | ||
_log | log4net.ILog |
Method | Description | |
---|---|---|
AddCoercibleType ( |
A method to add a coercion delegate for a type, without exposing the dictionary.
|
|
CoerceType ( |
Attempts to convert the value into the given type. While broadly similar to Convert.ChangeType, that method doesn't support enums and this one does. Calling that from within this method makes it take nearly twice as long, so this method does its own type checking.
|
|
CreateQuery ( |
Builds the query based on a serializable criteria. The Query object is particular to the implementation, but may contain things like the parameters parsed out, or whatever makes sense to this FastDaoLayer. You can think of this method as a method to convert from the generic DaoCriteria into the specific details necessary for querying.
|
|
Delete ( ITransaction transaction, |
Deletes a data object record using the mapping and criteria for what's deleted.
|
|
DisposeOfQuery ( IDaQuery query ) : void |
Should be called when you're done with the query. Allows us to cache the objects for reuse.
|
|
ExecuteQuery ( ITransaction transaction, |
Executes a query and invokes a method with a DataReader of results.
|
|
GetCount ( ITransaction transaction, |
Gets a count of records for the given criteria, aggregated by the given grouping expressions. This matches "GROUP BY" behavior in SQL.
|
|
GetCount ( ITransaction transaction, |
Gets a count of records for the given criteria.
|
|
GetLastAutoGeneratedId ( ITransaction transaction, |
Finds the last generated id number for a column.
|
|
GetNextSequenceValue ( ITransaction transaction, string sequenceName ) : int |
Gets the next id number from a sequence in the data source.
|
|
Insert ( ITransaction transaction, |
Inserts a data object record using the "table" and a list of column/value pairs.
|
|
InsertBatch ( ITransaction transaction, |
Inserts a list of data object records of the same type. The default implementation merely calls Insert for each one, however some datasources may have more efficient ways of inserting multiple records that the appropriate DaLayer will take advantage of.
|
|
SupportsNumRecords ( ) : bool |
If true, methods that return numbers of records affected will be returning accurate numbers. If false, they will return UNKNOWN_NUM_ROWS.
|
|
Truncate ( |
Deletes all contents of the table. Faster for large tables than DeleteAll, but requires greater permissions. For layers that do not support this, the behavior should be the same as calling Delete(null, mapping).
|
|
Update ( ITransaction transaction, |
Updates a data object record using the "table" and a list of column/value pairs.
|
|
UpdateBatch ( ITransaction transaction, |
Updates a list of data object records of the same type. The default implementation merely calls Update for each one, however some datasources may have more efficient ways of inserting multiple records that the appropriate DaLayer will take advantage of.
|
Method | Description | |
---|---|---|
AbstractDaLayer ( IConnectionDescriptor connDesc, bool supportsNumRecords ) : System |
Instantiates the data access layer with the connection descriptor for the DB.
|
|
GetDataType ( string col, |
Given the class mapping and the column name, determines the appropriate c# data type.
|
protected AbstractDaLayer ( IConnectionDescriptor connDesc, bool supportsNumRecords ) : System | ||
connDesc | IConnectionDescriptor | The connection descriptor that is being used by this FastDaoLayer. |
supportsNumRecords | bool | If true, methods that return numbers of records affected will be /// returning accurate numbers. If false, they will probably return /// FastDAO.UNKNOWN_NUM_ROWS. |
return | System |
public AddCoercibleType ( |
||
t | The type to coerce. | |
coercionDelegate | TypeCoercionDelegate | How to coerce it. |
return | void |
public CoerceType ( |
||
desiredType | Type we need the value to be. | |
input | object | Input value, may or may not already be the right type. |
return | object |
public abstract CreateQuery ( |
||
mapping | The mapping of the table for which to build the query string. | |
crit | The criteria to use to find the desired objects. | |
return | IDaQuery |
public abstract Delete ( ITransaction transaction, |
||
transaction | ITransaction | The transaction to do this as part of. |
mapping | The mapping of the table from which to delete. | |
crit | Criteria for deletion. NOTE: Only the expressions are observed, /// other things (like "order" or start / limit) are ignored. /// WARNING: A null or empty (no expression) criteria will /// delete ALL records! | |
return | int |
public abstract DisposeOfQuery ( IDaQuery query ) : void | ||
query | IDaQuery | Query you're done using. |
return | void |
public abstract ExecuteQuery ( ITransaction transaction, |
||
transaction | ITransaction | The transaction to do this as part of. |
mapping | Class mapping for the table we're querying against. Optional, /// but not all columns may be properly typed if it is null. | |
query | IDaQuery | The query to execute, should have come from CreateQuery. |
invokeMe | DataReaderDelegate | The method to invoke with the IDataReader results. |
parameters | A hashtable containing any values that need to be persisted through invoked method. /// The list of objects from the query will be placed here. | |
return | void |
public abstract GetCount ( ITransaction transaction, |
||
transaction | ITransaction | The transaction to do this as part of. |
mapping | The mapping of the table for which to build the query string. | |
crit | The criteria to use for "where" comparisons. | |
groupExpressions | ICollection |
The fields/expressions to aggregate on when counting. |
return | List |
public abstract GetCount ( ITransaction transaction, |
||
transaction | ITransaction | The transaction to do this as part of. |
mapping | The mapping of the table for which to build the query string. | |
crit | The criteria to use for "where" comparisons. | |
return | int |
protected GetDataType ( string col, |
||
col | string | Column to look up. |
mapping | Mapping for the class we're creating a table for. | |
return |
public abstract GetLastAutoGeneratedId ( ITransaction transaction, |
||
transaction | ITransaction | The transaction to do this as part of. |
mapping | The class mapping for the table being queried. | |
idCol | string | The ID column for which to find the last-generated ID. |
return | object |
public abstract GetNextSequenceValue ( ITransaction transaction, string sequenceName ) : int | ||
transaction | ITransaction | The transaction to do this as part of. |
sequenceName | string | The name of the sequence. |
return | int |
public abstract Insert ( ITransaction transaction, |
||
transaction | ITransaction | The transaction to do this as part of. |
mapping | The mapping of the table or other data container we're dealing with. | |
propValues | object>.IDictionary | A dictionary of "column"/value pairs for the object to insert. |
return | int |
public InsertBatch ( ITransaction transaction, |
||
transaction | ITransaction | The transaction to do this as part of. |
mapping | The mapping of the table or other data container we're dealing with. | |
propValueDictionaries | object>.List | A list of dictionaries of column/value pairs. /// Each item in the list should represent the dictionary of column/value pairs for /// each respective object being inserted. |
return | void |
public abstract Truncate ( |
||
mapping | ||
return | void |
public abstract Update ( ITransaction transaction, |
||
transaction | ITransaction | The transaction to do this as part of. |
mapping | The mapping of the table or other data container we're dealing with. | |
crit | All records matching this criteria will be updated per the dictionary of /// values. | |
propValues | object>.IDictionary | A dictionary of column/value pairs for all non-ID columns to be updated. |
return | int |
public UpdateBatch ( ITransaction transaction, |
||
transaction | ITransaction | The transaction to do this as part of. |
mapping | The mapping of the table or other data container we're dealing with. | |
criteriaList | List |
A list of DaoCriteria. /// Each item in the list should represent the criteria for /// rows that will be updated per the accompanying dictionary. |
propValueDictionaries | object>.List | A list of dictionaries of column/value pairs. /// Each item in the list should represent the dictionary of non-ID column/value pairs for /// each respective object being updated. |
return | void |
protected Dictionary |
||
return | TypeCoercionDelegate>.Dictionary |
protected IConnectionDescriptor _connDesc | ||
return | IConnectionDescriptor |