Method | Description | |
---|---|---|
CreateIndex ( string name, ClassMapping mapping, ICollection |
Indexes the data for faster queries. Some data sources may not support indexes (such as CSV files), in which case this should throw a NotSupportedException. If the data source supports indexes, but support for creating them is not yet implemented, this should throw a NotImplementedException.
|
|
CreateSequence ( string name ) : void |
Sequences are things that automatically generate unique, usually incrementing, numbers. Some data sources may not support sequences, in which case this should throw a NotSupportedException. If the data source supports sequences, but support for creating them is not yet implemented, this should throw a NotImplementedException.
|
|
CreateStoreHouse ( ) : void |
Creates the store house specified in the connection descriptor. If this data source doesn't use a store house, this method should be a no-op. If this data source DOES use store houses, but support for adding them is not implemented yet, this should throw a NotImplementedException. Store house typically corresponds to "database".
|
|
CreateStoreRoom ( ClassMapping mapping ) : void |
Creates the store room specified in the connection descriptor. If this data source doesn't use a store room, this method should be a no-op. If this data source DOES use store rooms, but support for adding them is not implemented yet, this should throw a NotImplementedException. Store room typically corresponds to "table".
|
|
DeleteIndex ( string name, ClassMapping mapping ) : void |
Removes an index on the data for slower queries (but usually faster inserts/updates/deletes). Some data sources may not support indexes (such as CSV files), in which case this method should be a no-op. If the data source supports indexes, but support for deleting them is not yet implemented, this should throw a NotImplementedException. If there is no index with the given name, this should be a no-op.
|
|
DeleteSequence ( string name ) : void |
Removes a sequence. Some data sources may not support sequences, in which case this method should be a no-op. If the data source supports sequences, but support for deleting them is not yet implemented, this should throw a NotImplementedException. If there is no sequence with the given name, this should be a no-op.
|
|
DeleteStoreHouse ( ) : void |
Deletes the store house specified in the connection descriptor. If this data source doesn't use a store house, this method should be a no-op. If this data source DOES use store houses, but support for dropping them is not implemented yet, this should throw a NotImplementedException. Store house typically corresponds to "database". If there is no store house with the given name, this should be a no-op.
|
|
DeleteStoreRoom ( ClassMapping mapping ) : void |
Deletes the store room specified in the connection descriptor. If this data source doesn't use a store room, this method should be a no-op. If this data source DOES use store rooms, but support for adding them is not implemented yet, this should throw a NotImplementedException. Store room typically corresponds to "table". If there is no store room with the given name, this should be a no-op.
|
|
GenerateClassMappingFromStoreRoom ( string storeRoomName, IComparer |
Uses some form of introspection to determine what data is stored in this data store, and generates a ClassMapping that can be immediately used with a DictionaryDAO. As much data as practical will be populated on the ClassMapping, at a bare minimum the Table (typically set to the storeRoomName passed in, or the more correct or fully qualified version of that name), the TypeName (set to the storeRoomName, since we have no .NET type), and the "data cols" and "obj attrs" will be the list of attributes / columns in the data source, mapped to themselves.
|
|
IndexExists ( string name, ClassMapping mapping ) : bool |
Returns whether an index with this name exists or not. NOTE: This does NOT verify what properties the index is on, merely whether an index with this name is already present.
|
|
SequenceExists ( string name ) : bool |
Returns whether a sequence with this name exists or not.
|
|
StoreHouseMissing ( ) : bool |
Returns true if you need to call "CreateStoreHouse" before storing any data. This method is "Missing" not "Exists" because implementations that do not use a store house (I.E. single-file-based data access layers) can return "false" from this method without breaking either a user's app or the spirit of the method. Store house typically corresponds to "database".
|
|
StoreRoomMissing ( ClassMapping mapping ) : bool |
Returns true if you need to call "CreateStoreRoom" before storing any data. This method is "Missing" not "Exists" because implementations that do not use a store room can return "false" from this method without breaking either a user's app or the spirit of the method. Store room typically corresponds to "table".
|
Method | Description | |
---|---|---|
AddColDefinition ( StringBuilder sb, string col, ClassMapping mapping, string separator, ICollection |
Add the definition for the given column to the create table statement.
|
|
GetAsciiStringType ( ) : string |
Returns the SQL type used to store an ascii string in the DB.
|
|
GetAutoType ( |
Returns the DDL for the type of an automatically incrementing column. Some databases only store autonums in one col type so baseType may be ignored.
|
|
GetBooleanType ( ) : string |
Returns the SQL type used to store a boolean in the DB.
|
|
GetByteArrayType ( ) : string |
Returns the SQL type used to store a byte array in the DB.
|
|
GetByteType ( ) : string |
Returns the SQL type used to store a byte in the DB.
|
|
GetCharType ( ) : string |
Returns the SQL type used to store a char in the DB.
|
|
GetDateTimeType ( ) : string |
Returns the SQL type used to store a DateTime in the DB.
|
|
GetDoubleType ( ) : string |
Returns the SQL type used to store a double in the DB.
|
|
GetFloatType ( ) : string |
Returns the SQL type used to store a float in the DB.
|
|
GetGeneratorType ( string col, ClassMapping mapping ) : GeneratorType |
For a column, returns the type of generator used for it.
|
|
GetIntType ( ) : string |
Returns the SQL type used to store an integer in the DB.
|
|
GetLongType ( ) : string |
Returns the SQL type used to store a long in the DB.
|
|
GetShortType ( ) : string |
Returns the SQL type used to store a short in the DB.
|
|
GetStringType ( ) : string |
Returns the SQL type used to store a "normal" (unicode) string in the DB.
|
|
SqlDaDdlLayer ( |
Instantiates the data access layer with the connection descriptor for the DB.
|
protected AddColDefinition ( StringBuilder sb, string col, ClassMapping mapping, string separator, ICollection |
||
sb | StringBuilder | Current create table statement to append to. |
col | string | Name of the column to add a definition for. |
mapping | ClassMapping | Classmap for the class we're generating columns for. |
separator | string | Separator to use before appending to sb. |
extraStatements | ICollection |
If adding this column requires any additional /// SQL statements to be run afterwards, put them here. |
return | bool |
public CreateIndex ( string name, ClassMapping mapping, ICollection |
||
name | string | Name of the index. Some data sources require names for indexes, /// and even if not this is required so the index can be deleted if desired. |
mapping | ClassMapping | ClassMapping for the data that is being indexed. |
propertyNames | ICollection |
Names of the data properties to include in the index (in order). |
return | void |
public CreateSequence ( string name ) : void | ||
name | string | Name of the new sequence to create. |
return | void |
public CreateStoreRoom ( ClassMapping mapping ) : void | ||
mapping | ClassMapping | ClassMapping for the data that will be stored in this room. |
return | void |
public DeleteIndex ( string name, ClassMapping mapping ) : void | ||
name | string | Name of the index to delete. |
mapping | ClassMapping | ClassMapping for the data that was being indexed. |
return | void |
public DeleteSequence ( string name ) : void | ||
name | string | Name of the sequence to delete. |
return | void |
public DeleteStoreRoom ( ClassMapping mapping ) : void | ||
mapping | ClassMapping | ClassMapping for the data that was stored in this room. |
return | void |
public GenerateClassMappingFromStoreRoom ( string storeRoomName, IComparer |
||
storeRoomName | string | The name of the storeroom (I.E. table). May be null /// if this data source does not use store rooms. |
columnSorter | IComparer |
If you wish the columns / attributes to be in a particular /// order, supply this optional parameter. May be null. |
return | ClassMapping |
protected abstract GetAutoType ( |
||
baseType | The data type of the column (nominally). | |
return | string |
protected abstract GetByteArrayType ( ) : string | ||
return | string |
protected GetGeneratorType ( string col, ClassMapping mapping ) : GeneratorType | ||
col | string | Column to look up. |
mapping | ClassMapping | Mapping for the class we're creating a table for. |
return | GeneratorType |
public IndexExists ( string name, ClassMapping mapping ) : bool | ||
name | string | Name of the index to check for. |
mapping | ClassMapping | ClassMapping for the data that may be indexed. |
return | bool |
public SequenceExists ( string name ) : bool | ||
name | string | Name of the sequence to check for. |
return | bool |
protected SqlDaDdlLayer ( |
||
connDesc | 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 StoreRoomMissing ( ClassMapping mapping ) : bool | ||
mapping | ClassMapping | |
return | bool |