OpenPetra
Free Administration Software for Non-Profits
Ict.Tools.DBXML.TDataSetTable Class Reference
Inheritance diagram for Ict.Tools.DBXML.TDataSetTable:
Ict.Tools.DBXML.TTable

Public Member Functions

 TDataSetTable (string tableorig, string tablename, string tablealias, TTable origtable)
 constructor More...
 
void Assign (TTable AOtherTable)
 copy the values from another table; used for generating datasets by deriving from database tables More...
 
TTableField GetField (string s, bool AShowWarningNonExistingField=true)
 return the reference to a column, given by name More...
 
TConstraint GetConstraint (StringCollection fields)
 get the reference to the constraint which is based on the columns that are passed as parameter More...
 
Boolean IsKey (String AFieldname, String AKeyType)
 determine if a given field is part of a certain type of constraint More...
 
bool HasPrimaryKey ()
 determine whether the table has a primary key More...
 
bool HasUniqueKey ()
 determine whether the table has a unique key More...
 
bool HasForeignKey ()
 determine whether the table has any foreign key constraints More...
 
TConstraint GetPrimaryKey ()
 get a reference to the primary key More...
 
TConstraint GetFirstUniqueKey ()
 get a reference to the first unique key More...
 
ArrayList GetReferences ()
 get the list of constraints of other tables, that reference this table More...
 
void AddReference (TConstraint AForeignKey)
 add a foreign key from another table, that is referencing this table More...
 
void PrepareLinks (TDataDefinitionStore db)
 set the references in the tables referenced by the constraints of this table More...
 
void PrepareAutoGeneratedFields ()
 create the auto generated fields (eg. createdby, datemodified) More...
 
Boolean TestIndex (TIndex AIndex)
 
Boolean AddIndex (TIndex AIndex)
 
string PrepareSQLInsertStatement ()
 prepare an INSERT statement for this table More...
 
List< OdbcParameter > PrepareParametersInsertStatement (string line)
 prepare the parameters for an INSERT statement, from a CSV line More...
 

Static Public Member Functions

static string NiceTableName (string s)
 change the name from the sql name to a Delphi class name remove underscores, use capitalised letters More...
 
static string NiceFieldName (TTableField tableField)
 change the name from the sql name to a Delphi variable name remove underscores, remove prefixes and type identifiers, use capitalised letters More...
 
static string NiceFieldName (String tableField)
 format the name of a column using Camelcase and dropping prefix/postfix More...
 
static string NiceKeyName (TConstraint c)
 change the name of the constraint from the sql name to a .net name remove underscores, use capitalised letters, prepend FK or call it PrimaryKey More...
 
static string GetNamespace (string AStrGroup)
 get the namespace for this table, eg. MPersonnel.Units More...
 

Public Attributes

string tableorig
 the table name from the sql database More...
 
string tablename
 the CamelCase name of the table More...
 
string tablealias
 an alias for the table More...
 
List< TTableFieldgrpTableField
 the columns of the table More...
 
List< TIndexgrpIndex
 the indexes in the table More...
 
List< TConstraintgrpConstraint
 the constraints (foreign, unique, primary) of the table More...
 
string strName
 the name of the table (as it is in the database) More...
 
int iOrder
 order of the table More...
 
string strDotNetName
 the name of the table as it should be used in dotnet More...
 
string strVariableNameInDataset = null
 the name of the table when it is used in a dataset; empty otherwise. More...
 
string strDumpName
 the name used for dumping the table More...
 
string strDescription
 a description of the table More...
 
string strArea
 define which area in the db this table belongs to More...
 
string strLabel
 even shorter description than strDescription More...
 
Boolean ExistsStrLabel
 is there a label at all? More...
 
string strGroup
 each table belongs to a certain group, which helps with the HTML documentation of the database structure More...
 
bool bWithoutCRMDFields
 created / modified fields More...
 
bool bCatchUpdateException
 attempt an insert instead of failed update in SubmitChanges in DataAccess More...
 
ArrayList FReferenced
 references to this table from other tables list of TConstraints More...
 
String CustomReportPermission
 which permission is needed to access this table with a custom report More...
 
Boolean AvailableForCustomReport
 is this table available for custom reports More...
 

Static Public Attributes

static Boolean GEnabledLoggingMissingFields = true
 this for debugging; it helps to find columns that are missing More...
 

Detailed Description

this describes a table that is derived from a database table, has additional custom fields, or is completely customised

Constructor & Destructor Documentation

◆ TDataSetTable()

Ict.Tools.DBXML.TDataSetTable.TDataSetTable ( string  tableorig,
string  tablename,
string  tablealias,
TTable  origtable 
)
inline

constructor

Parameters
tableorigthe sql name of the table
tablenamethe name of the table in CamelCase
tablealiaswhich alias to use for the table
origtablethis is an instance of a table that should be used as a base

Member Function Documentation

◆ AddIndex()

Boolean Ict.Tools.DBXML.TTable.AddIndex ( TIndex  AIndex)
inlineinherited

only add the index if it does not exist yet

◆ AddReference()

void Ict.Tools.DBXML.TTable.AddReference ( TConstraint  AForeignKey)
inlineinherited

add a foreign key from another table, that is referencing this table

Parameters
AForeignKeyforeign key to add

◆ Assign()

void Ict.Tools.DBXML.TTable.Assign ( TTable  AOtherTable)
inlineinherited

copy the values from another table; used for generating datasets by deriving from database tables

Parameters
AOtherTable

◆ GetConstraint()

TConstraint Ict.Tools.DBXML.TTable.GetConstraint ( StringCollection  fields)
inlineinherited

get the reference to the constraint which is based on the columns that are passed as parameter

Parameters
fieldsthe fields that are part of the constraint that we look for
Returns
the reference to the constraint

◆ GetField()

TTableField Ict.Tools.DBXML.TTable.GetField ( string  s,
bool  AShowWarningNonExistingField = true 
)
inlineinherited

return the reference to a column, given by name

Parameters
sname of the column
AShowWarningNonExistingFieldshow warning if there is no field with that name; only takes effect if GEnabledLoggingMissingFields is true
Returns
reference to the column

◆ GetFirstUniqueKey()

TConstraint Ict.Tools.DBXML.TTable.GetFirstUniqueKey ( )
inlineinherited

get a reference to the first unique key

Returns
the first unique key of the table

◆ GetNamespace()

static string Ict.Tools.DBXML.TTable.GetNamespace ( string  AStrGroup)
inlinestaticinherited

get the namespace for this table, eg. MPersonnel.Units

◆ GetPrimaryKey()

TConstraint Ict.Tools.DBXML.TTable.GetPrimaryKey ( )
inlineinherited

get a reference to the primary key

Returns
the primary key of the table

◆ GetReferences()

ArrayList Ict.Tools.DBXML.TTable.GetReferences ( )
inlineinherited

get the list of constraints of other tables, that reference this table

Returns
the list of constraints of other tables, that reference this table

◆ HasForeignKey()

bool Ict.Tools.DBXML.TTable.HasForeignKey ( )
inlineinherited

determine whether the table has any foreign key constraints

Returns
true if the table has at least one foreign key constraint

◆ HasPrimaryKey()

bool Ict.Tools.DBXML.TTable.HasPrimaryKey ( )
inlineinherited

determine whether the table has a primary key

Returns
true if the table has a primary key constraint

◆ HasUniqueKey()

bool Ict.Tools.DBXML.TTable.HasUniqueKey ( )
inlineinherited

determine whether the table has a unique key

Returns
true if the table has a unique key constraint

◆ IsKey()

Boolean Ict.Tools.DBXML.TTable.IsKey ( String  AFieldname,
String  AKeyType 
)
inlineinherited

determine if a given field is part of a certain type of constraint

Parameters
AFieldnamethe field in question
AKeyTypea type of constraint, eg. unique, primary, foreign key
Returns
true if the field is part of a key of the given type

◆ NiceFieldName() [1/2]

static string Ict.Tools.DBXML.TTable.NiceFieldName ( String  tableField)
inlinestaticinherited

format the name of a column using Camelcase and dropping prefix/postfix

Parameters
tableFieldthe name to format
Returns
nice name

◆ NiceFieldName() [2/2]

static string Ict.Tools.DBXML.TTable.NiceFieldName ( TTableField  tableField)
inlinestaticinherited

change the name from the sql name to a Delphi variable name remove underscores, remove prefixes and type identifiers, use capitalised letters

Parameters
tableFieldthe reference to the column which you want the nice name of
Returns
the column name without prefix and postfix

◆ NiceKeyName()

static string Ict.Tools.DBXML.TTable.NiceKeyName ( TConstraint  c)
inlinestaticinherited

change the name of the constraint from the sql name to a .net name remove underscores, use capitalised letters, prepend FK or call it PrimaryKey

Parameters
cthe constraint
Returns
nice name for the key

◆ NiceTableName()

static string Ict.Tools.DBXML.TTable.NiceTableName ( string  s)
inlinestaticinherited

change the name from the sql name to a Delphi class name remove underscores, use capitalised letters

Parameters
sturn the table name into CamelCase
Returns

◆ PrepareAutoGeneratedFields()

void Ict.Tools.DBXML.TTable.PrepareAutoGeneratedFields ( )
inlineinherited

create the auto generated fields (eg. createdby, datemodified)

◆ PrepareLinks()

void Ict.Tools.DBXML.TTable.PrepareLinks ( TDataDefinitionStore  db)
inlineinherited

set the references in the tables referenced by the constraints of this table

Parameters
db

◆ PrepareParametersInsertStatement()

List< OdbcParameter > Ict.Tools.DBXML.TTable.PrepareParametersInsertStatement ( string  line)
inlineinherited

prepare the parameters for an INSERT statement, from a CSV line

◆ PrepareSQLInsertStatement()

string Ict.Tools.DBXML.TTable.PrepareSQLInsertStatement ( )
inlineinherited

prepare an INSERT statement for this table

◆ TestIndex()

Boolean Ict.Tools.DBXML.TTable.TestIndex ( TIndex  AIndex)
inlineinherited

checks if all the fields of the index exist in the table

Member Data Documentation

◆ AvailableForCustomReport

Boolean Ict.Tools.DBXML.TTable.AvailableForCustomReport
inherited

is this table available for custom reports

◆ bCatchUpdateException

bool Ict.Tools.DBXML.TTable.bCatchUpdateException
inherited

attempt an insert instead of failed update in SubmitChanges in DataAccess

◆ bWithoutCRMDFields

bool Ict.Tools.DBXML.TTable.bWithoutCRMDFields
inherited

created / modified fields

◆ CustomReportPermission

String Ict.Tools.DBXML.TTable.CustomReportPermission
inherited

which permission is needed to access this table with a custom report

◆ ExistsStrLabel

Boolean Ict.Tools.DBXML.TTable.ExistsStrLabel
inherited

is there a label at all?

◆ FReferenced

ArrayList Ict.Tools.DBXML.TTable.FReferenced
inherited

references to this table from other tables list of TConstraints

◆ GEnabledLoggingMissingFields

Boolean Ict.Tools.DBXML.TTable.GEnabledLoggingMissingFields = true
staticinherited

this for debugging; it helps to find columns that are missing

◆ grpConstraint

List<TConstraint> Ict.Tools.DBXML.TTable.grpConstraint
inherited

the constraints (foreign, unique, primary) of the table

◆ grpIndex

List<TIndex> Ict.Tools.DBXML.TTable.grpIndex
inherited

the indexes in the table

◆ grpTableField

List<TTableField> Ict.Tools.DBXML.TTable.grpTableField
inherited

the columns of the table

◆ iOrder

int Ict.Tools.DBXML.TTable.iOrder
inherited

order of the table

◆ strArea

string Ict.Tools.DBXML.TTable.strArea
inherited

define which area in the db this table belongs to

◆ strDescription

string Ict.Tools.DBXML.TTable.strDescription
inherited

a description of the table

◆ strDotNetName

string Ict.Tools.DBXML.TTable.strDotNetName
inherited

the name of the table as it should be used in dotnet

◆ strDumpName

string Ict.Tools.DBXML.TTable.strDumpName
inherited

the name used for dumping the table

◆ strGroup

string Ict.Tools.DBXML.TTable.strGroup
inherited

each table belongs to a certain group, which helps with the HTML documentation of the database structure

◆ strLabel

string Ict.Tools.DBXML.TTable.strLabel
inherited

even shorter description than strDescription

◆ strName

string Ict.Tools.DBXML.TTable.strName
inherited

the name of the table (as it is in the database)

◆ strVariableNameInDataset

string Ict.Tools.DBXML.TTable.strVariableNameInDataset = null
inherited

the name of the table when it is used in a dataset; empty otherwise.

◆ tablealias

string Ict.Tools.DBXML.TDataSetTable.tablealias

an alias for the table

◆ tablename

string Ict.Tools.DBXML.TDataSetTable.tablename

the CamelCase name of the table

◆ tableorig

string Ict.Tools.DBXML.TDataSetTable.tableorig

the table name from the sql database


The documentation for this class was generated from the following file: