cplusDBAction 4.2                                                                                        Copyright addoit GmbH 2009

 

 

5.4 cplusDBAction Code Generator

 

A RDBM schema mostly contains a collection of tables and fields as seen in Picture 3: DBGenType - a sample RDBM Schema.

 

Picture 3: DBGenType - a sample RDBM Schema

 

To create a User DBTableSet named „DBGenType“ out of this schema, all you have to do is launch the code generator in a console window with the parameters provided in  Picture 4: Code Generator usage:

 

Picture 4: Code Generator usage

 

This command will connect to the MS-SQL Server (-P 10) at address serveraddress (-h serveraddress), schema name dbo (-s dbo) and DBUserName sa (-u sa) and generate the following files in the folder “C:\work\DBGenType” (-E C:\work\DBGenType):

 

Class name

Header Location

DBGenType\Include

Source Location

DBGenType\Source

Description

clsDBGenType

heaDBGenType.h

cppDBGenType.cpp

Table Container;

Derived from DBTableSet

clsCollComplexType

heaComplexType.h

cppComplexType.cpp

Collection of ComplexType Items

clsComplexType

heaComplexType.h

cppComplexType.cpp

ComplexType Properties;

Column Properties

clsCollDeclarationType

heaDeclarationType.h

cppDeclarationType.cpp

Collection of DeclarationType Items

clsDeclarationType

heaDeclarationType.h

cppDeclarationType.cpp

DeclarationType Properties;

Column Properties

clsCollComplexTypeItem

heaComplexTypeItem.h

cppComplexTypeItem.cpp

Collection of ComplexTypeItem Items

clsComplexTypeItem

heaComplexTypeItem.h

cppComplexTypeItem.cpp

ComplexTypeItem Properties;

Column Properties

clsCollDeclaration

heaDeclaration.h

cppDeclaration.cpp

Collection of Declaration Items

clsDeclaration

heaDeclaration.h

cppDeclaration.cpp

Declaration Properties;

Column Properties

 

 

The clsDBGenType class manages all the tables. In order to perform any action, an instance of this class must be created. This can be achieved using the following static method:

 

static clsDBGenType::Open (..,..,clsDBGenType** v_ppobjDBGenType, .., ..);

 

The DBTableSet (in our case DBGenType) manages all actions like Select(), Update(), Insert(), Delete(), Cache() and Save().

 

Related Topics

5 cplusDBAction Functionality
5.4.1 cplusDBAction Code Generator conventions


Copyright (c) 1998-2009 addoit GmbH, All Rights Reserved.

www.addoit.com                                                                                                          Page 1 of 52