Свойство | Type | Description | |
---|---|---|---|
_connDesc |
Méthode | Description | |
---|---|---|
CoerceType ( |
Overridden to handle the case of converting an empty string to a non-string datatype. It's a slow check because you have to trim, and check type, etc, which is why it isn't in the base class. But CSV files apparently frequently use "" for blank numerical values which causes the base class implementation to error out.
|
|
CsvDaLayer ( |
Instantiates the data access layer with the connection descriptor for the DB.
|
|
Delete ( ITransaction transaction, ClassMapping mapping, |
Deletes a data object record using the mapping and criteria for what's deleted.
|
|
ExecuteQuery ( ITransaction transaction, ClassMapping mapping, IDaQuery query, DataReaderDelegate invokeMe, |
Executes a query and invokes a method with a DataReader of results.
|
|
GetCount ( ITransaction transaction, ClassMapping mapping, |
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, ClassMapping mapping, |
Gets a count of records for the given criteria.
|
|
GetLastAutoGeneratedId ( ITransaction transaction, ClassMapping mapping, string idCol ) : object |
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, ClassMapping mapping, object>.IDictionary |
Inserts a data object record using the "table" and a list of column/value pairs.
|
|
InsertBatch ( ITransaction transaction, ClassMapping mapping, object>.List |
Inserts a list of data object records of the same type.
|
|
Truncate ( ClassMapping mapping ) : void |
Blanks the file, leaving nothing but the header row (if there is one).
|
|
Update ( ITransaction transaction, ClassMapping mapping, |
Updates a data object record using the "table" and a list of column/value pairs.
|
|
UpdateBatch ( ITransaction transaction, ClassMapping mapping, List |
Updates a list of data object records of the same type. NOTE: At the moment this just loops calling Update().
|
Méthode | Description | |
---|---|---|
DoneWithReader ( |
Returns the reader for closing (or not, if we were configured with it).
|
|
DoneWithWriter ( |
Returns the writer for closing (or not, if we were configured with it).
|
|
GetReader ( ClassMapping mapping ) : |
Gets a valid StreamReader that can be used to read CSV data. If we were configured with a StreamReader, it may be that one. If we are accessing a file we will open a new reader. You should not close it yourself, instead you should call DoneWithReader when you are done with it.
|
|
GetWriter ( ClassMapping mapping, bool append ) : |
Gets a valid TextWriter that can be used to output CSV data. If we were configured with a TextWriter, it may be that one. If we are accessing a file we will open a new writer. You should not close it yourself, instead you should call DoneWithWriter when you are done with it.
|
|
UseNamedColumns ( ClassMapping mapping ) : bool |
Checks whether this mapping is using column indexes or named columns. If named columns, returns true (and there must be a header row). If numerically indexed columns, returns false (we assume there is not a header row).
|
Méthode | Description | |
---|---|---|
GetFileName ( ClassMapping mapping ) : string | ||
MakeDataRow ( ClassMapping mapping, object>.IDictionary |
Creates a new row for the CSV file. Will create blanks (",,") if using numeric indexing and the numbers are not consecutive.
|
|
MakeHeaderRow ( ClassMapping mapping ) : string |
Creates the first row of the CSV file, the header row.
|
|
QuoteValue ( object val ) : string |
Uses the OutputQuoteLevel on the connection descriptor plus the value itself to determine if we need to quote it, and if so quote it. Also converts the value to a string, and if it is already a string, escapes internal quotes in it.
|
public CoerceType ( |
||
desiredType | Type we need the value to be. | |
input | object | Input value, may or may not already be the right type. |
Résultat | object |
public CsvDaLayer ( |
||
connDesc | The connection descriptor that is being used by this FastDaoLayer. | |
Résultat | System |
public Delete ( ITransaction transaction, ClassMapping mapping, |
||
transaction | ITransaction | Should be null, transactions are not supported. |
mapping | ClassMapping | 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! | |
Résultat | int |
protected DoneWithReader ( |
||
reader | The StreamReader obtained from a GetReader call. | |
Résultat | void |
protected DoneWithWriter ( |
||
info | The WriterInfo obtained from a GetWriter call. | |
Résultat | void |
public ExecuteQuery ( ITransaction transaction, ClassMapping mapping, IDaQuery query, DataReaderDelegate invokeMe, |
||
transaction | ITransaction | Should be null, transactions are not supported. |
mapping | ClassMapping | 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. | |
Résultat | void |
public GetCount ( ITransaction transaction, ClassMapping mapping, |
||
transaction | ITransaction | The transaction to do this as part of. |
mapping | ClassMapping | 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. |
Résultat | List |
public GetCount ( ITransaction transaction, ClassMapping mapping, |
||
transaction | ITransaction | Should be null, transactions are not supported. |
mapping | ClassMapping | The mapping of the table for which to build the query string. |
crit | The criteria to use for "where" comparisons. | |
Résultat | int |
public GetLastAutoGeneratedId ( ITransaction transaction, ClassMapping mapping, string idCol ) : object | ||
transaction | ITransaction | Should be null, transactions are not supported. |
mapping | ClassMapping | The class mapping for the table being queried. |
idCol | string | The ID column for which to find the last-generated ID. |
Résultat | object |
public GetNextSequenceValue ( ITransaction transaction, string sequenceName ) : int | ||
transaction | ITransaction | Should be null, transactions are not supported. |
sequenceName | string | The name of the sequence. |
Résultat | int |
protected GetReader ( ClassMapping mapping ) : |
||
mapping | ClassMapping | The mapping for the object we intend to read. |
Résultat |
protected GetWriter ( ClassMapping mapping, bool append ) : |
||
mapping | ClassMapping | The mapping for the object we intend to write. |
append | bool | Whether to append to, or overwrite, the file if it exists. /// If it does not exist, this parameter doesn't matter and a new /// file is created. |
Résultat |
public Insert ( ITransaction transaction, ClassMapping mapping, object>.IDictionary |
||
transaction | ITransaction | Should be null, transactions are not supported. |
mapping | ClassMapping | 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. |
Résultat | int |
public InsertBatch ( ITransaction transaction, ClassMapping mapping, object>.List |
||
transaction | ITransaction | Should be null, transactions are not supported. |
mapping | ClassMapping | 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. |
Résultat | void |
public Truncate ( ClassMapping mapping ) : void | ||
mapping | ClassMapping | |
Résultat | void |
public Update ( ITransaction transaction, ClassMapping mapping, |
||
transaction | ITransaction | Should be null, transactions are not supported. |
mapping | ClassMapping | 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. |
Résultat | int |
public UpdateBatch ( ITransaction transaction, ClassMapping mapping, List |
||
transaction | ITransaction | Should be null, transactions are not supported. |
mapping | ClassMapping | 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. |
Résultat | void |
protected static UseNamedColumns ( ClassMapping mapping ) : bool | ||
mapping | ClassMapping | Mapping for this file. |
Résultat | bool |