class: ConvertDBType

public class: ConvertDBType
Author:
Project: Phase: 1.0; Status: Proposed; Version: 1.0; Complexity: 1
Dates: Created: 6.12.2005 2:58:36; Modified: 10.12.2005 1:53:41;
Flags: Active: false; IsRoot: false; IsLeaf: false;
Extension Points:
UUID: {540E5DE3-6B5F-478b-9E34-9EC1616CB096}
Summary description for ConvertDBType. This class is used for conversion between common database types (e.g. unsigned integer, number, float, double, varchar, varchar2, ...) and defined simple types (e.g. INT, DOUBLE, STRING, ...) This conversion are saved in XML file specified in program settings.

 

Goto: Fields, Methods

See also: DBDataAdmin, SimpleType

Appears in: Database interface

Connections
 
ConvertDBType Attributes
Attribute Details
private ArrayList
  knownTypes
Notes: contain all known types (conversion from DB)

private ArrayList
  knownSimpleTypes
Notes: contain all known simple types (conversions to DB)

private string
  fileNameSimpleTypes
Notes: file name with configuration of simple types

private string
  pathNameSimpleTypes
Notes: path of file with configuration of simple types

private string
  fileNameConversions
Notes: file name with configuration of conversions

private string
  pathNameConversions
Notes: path of file with configuration of conversions

private bool
  changeInSimpleTypes
Notes: Express if any simple type is add to structure

private bool
  changeInConversions
Notes: Express if any conversion is add to structure

private bool
  failed
Notes: Expresss validity of this object

private ArrayList
  dbTypesFailed
Notes: Auxiliary list for better user friendly behavior

private DMTransformStruct.DBDataAdmin
  dbAdmin
Notes: Reference to data admin object

 
ConvertDBType Methods
Operation Details
public
ConvertDBType(
   DMTransformStruct.DBDataAdmin dbAdmin,
   string pathSimpleType,
   string fileSimpleType,
   string pathConversions,
   string fileConversions):
Notes: Constructor. Create object and load simple types and conversions.
private
LoadSimpleTypes(
   string pathName,
   string fileName):bool
Notes: Load all conversion between simple type and db type from XML file.

@returns true if succeed
private
LoadConversions(
   string pathName,
   string fileName):bool
Notes: Load all conversions (INT, DOUBLE, STRING, ...) from XML file

@returns true if succeed
public
Save():bool
Notes: Save information about simple types (if changed) and conversions (if changed)

@returns true if succeed
public
ConvertType(
   string newType):string
Notes: Convert from database or CSV type to database type

@param ="new_type" database or CSV type
@returns database type
public
ConvertToTypeSimple(
   string dbType):string
Notes: Convert from dbType to SimpleType

@returns dbSimpleType e.g. (INT, DOUBLE, STRING)
private
AddType(
   string typeFrom,
   string typeDB,
   string typeSimple):bool
Notes: Add type into internal array. Checks if typeSimple is known (is in knownSimpleTypes).

@returns true if type is add
private
AddSimpleType(
   SimpleType st):bool
Notes: Add common simple type.

@param ="simpleTypeName" E.g. INT, DOUBLE, STRING, ...
@param ="dbTypeSimple" E.g. integer, double, varchar, ...
@param ="simpleTypeDescription" E.g. description. It is shown if some db type is not recognized
@returns true always
public
FillUpComboBoxWithSimpleTypes(
   ComboBox cb):bool
Notes: Fill up combo box. It assumes knownSimpleTypes are in memory (at least one item).

@returns true, if add more than zero item
public
IsOK():bool
<<property>>
Notes: If object is Valid
public
ClearFailedTypes():void
Notes: Clear types marked as failed