BankAndCustomer
Lade ...
Suche ...
Keine Treffer
BankAndCustomerObjCreator.h
gehe zur Dokumentation dieser Datei
1// ****************************************************************************
2// Created by GlobalObjects source code generator version 1.0.9
3// Creation date: 2024.06.16 - 07:25:12
4// Database: "BankAndCustomer"
5//
6// WARNING! All changes made in this file will be lost!
7// ****************************************************************************
8//-----------------------------------------------------------------------------
9#ifndef INC_BANKANDCUSTOMEROBJCREATOR_H
10#define INC_BANKANDCUSTOMEROBJCREATOR_H
11
12#include <EuException.h>
13#include <GloTypes.h>
14#include <GloObjCreator.h>
15#include <GloTAllSet.h>
16
17// include persistent classes
18#include "Person.h"
19#include "LegalEntity.h"
20#include "NaturalPerson.h"
21#include "Bank.h"
22#include "BankAccount.h"
23//-----------------------------------------------------------------------------
24//BaseVersion:1718515510
25//-----------------------------------------------------------------------------
27{
28 public:
29 static const unsigned long ClassID_AllClasses = 0;
30 static const unsigned long ClassID_glo_Persistent = 1; // glo::Persistent
31 static const unsigned long ClassID_Person = 2; // Person
32 static const unsigned long ClassID_LegalEntity = 3; // LegalEntity
33 static const unsigned long ClassID_NaturalPerson = 4; // NaturalPerson
34 static const unsigned long ClassID_Bank = 5; // Bank
35 static const unsigned long ClassID_BankAccount = 6; // BankAccount
36
38 inline virtual ~BankAndCustomerObjCreator();
39
40 inline virtual std::string getBaseName() const;
41 inline virtual bool isKnownClassID( unsigned long ulClassID ) const;
42 inline virtual int getPersObject( glo::Persistent *& prNewObject, unsigned long ulClassID ) const;
43 inline virtual int getPersObject( std::shared_ptr< glo::Persistent > & rNewObject, unsigned long ulClassID ) const;
44 inline virtual unsigned long getClassID( glo::BaseAllSet * pAllSet ) const;
45 inline virtual ObjCreator * getCopy() const;
46};
47//-----------------------------------------------------------------------------
48#define SUPER ObjCreator
49//-----------------------------------------------------------------------------
54//-----------------------------------------------------------------------------
58//-----------------------------------------------------------------------------
60{
61 return "BankAndCustomer";
62}
63//-----------------------------------------------------------------------------
64inline bool BankAndCustomerObjCreator::isKnownClassID( unsigned long ulClassID ) const
65{
66 if (
67 ulClassID == ClassID_glo_Persistent // 1 -> glo::Persistent
68 ||
69 ulClassID == ClassID_Person // 2 -> Person
70 ||
71 ulClassID == ClassID_LegalEntity // 3 -> LegalEntity
72 ||
73 ulClassID == ClassID_NaturalPerson // 4 -> NaturalPerson
74 ||
75 ulClassID == ClassID_Bank // 5 -> Bank
76 ||
77 ulClassID == ClassID_BankAccount // 6 -> BankAccount
78 )
79 {
80 return true;
81 }
82 return false;
83}
84//-----------------------------------------------------------------------------
85inline int BankAndCustomerObjCreator::getPersObject( glo::Persistent *& prNewObject, unsigned long ulClassID ) const
86{
87 int t_iErr = 0;
88 glo::ObjID t_NewObjID( ulClassID, 0, 0 );
89
90 switch ( ulClassID )
91 {
92 case ClassID_glo_Persistent: // 1 -> glo::Persistent
93 {
94 prNewObject = new glo::Persistent();
95 break;
96 }
97 case ClassID_Person: // 2 -> Person
98 {
99 prNewObject = new Person();
100 break;
101 }
102 case ClassID_LegalEntity: // 3 -> LegalEntity
103 {
104 prNewObject = new LegalEntity();
105 break;
106 }
107 case ClassID_NaturalPerson: // 4 -> NaturalPerson
108 {
109 prNewObject = new NaturalPerson();
110 break;
111 }
112 case ClassID_Bank: // 5 -> Bank
113 {
114 prNewObject = new Bank();
115 break;
116 }
117 case ClassID_BankAccount: // 6 -> BankAccount
118 {
119 prNewObject = new BankAccount();
120 break;
121 }
122 default:
123 {
124 t_iErr = glo::ERR_UNKNOWN_CLASSID;
125 break;
126 }
127 } // END switch ( ulClassID )
128 if ( prNewObject )
129 {
130 prNewObject->setGloAttribute( "glo::Persistent.m_ObjID", & t_NewObjID );
131 }
132 return t_iErr;
133}
134//-----------------------------------------------------------------------------
135inline int BankAndCustomerObjCreator::getPersObject( std::shared_ptr< glo::Persistent > & rNewObject, unsigned long ulClassID ) const
136{
137 rNewObject.reset();
138
139 glo::Persistent * t_pPersistent = NULL_PTR;
140 int t_iErr = this->getPersObject( t_pPersistent, ulClassID );
141
142 if ( t_pPersistent )
143 {
144 rNewObject = std::shared_ptr< glo::Persistent >( t_pPersistent, glo::Forgeter< glo::Persistent >() );
145 }
146 return t_iErr;
147}
148//-----------------------------------------------------------------------------
149inline unsigned long BankAndCustomerObjCreator::getClassID( glo::BaseAllSet * pAllSet ) const
150{
151 unsigned long t_ulRetVal = 0;
152
153 glo::TAllSet<glo::Persistent> * t_pCastgloPersistent = dynamic_cast<glo::TAllSet<glo::Persistent>*>(pAllSet);
154 glo::TAllSet<Person> * t_pCastPerson = dynamic_cast<glo::TAllSet<Person>*>(pAllSet);
155 glo::TAllSet<LegalEntity> * t_pCastLegalEntity = dynamic_cast<glo::TAllSet<LegalEntity>*>(pAllSet);
156 glo::TAllSet<NaturalPerson> * t_pCastNaturalPerson = dynamic_cast<glo::TAllSet<NaturalPerson>*>(pAllSet);
157 glo::TAllSet<Bank> * t_pCastBank = dynamic_cast<glo::TAllSet<Bank>*>(pAllSet);
158 glo::TAllSet<BankAccount> * t_pCastBankAccount = dynamic_cast<glo::TAllSet<BankAccount>*>(pAllSet);
159
160 if ( t_pCastgloPersistent ) t_ulRetVal = ClassID_glo_Persistent; // 1 -> glo::Persistent
161 if ( t_pCastPerson ) t_ulRetVal = ClassID_Person; // 2 -> Person
162 if ( t_pCastLegalEntity ) t_ulRetVal = ClassID_LegalEntity; // 3 -> LegalEntity
163 if ( t_pCastNaturalPerson ) t_ulRetVal = ClassID_NaturalPerson; // 4 -> NaturalPerson
164 if ( t_pCastBank ) t_ulRetVal = ClassID_Bank; // 5 -> Bank
165 if ( t_pCastBankAccount ) t_ulRetVal = ClassID_BankAccount; // 6 -> BankAccount
166 if ( ! t_ulRetVal )
167 {
168 throw eut::ErrorNException( "BankAndCustomerObjCreator::getClassID( BaseAllSet * pAllSet ) const", glo::ERR_UNKNOWN_OBJECT_TYPE, __FILE__, __LINE__ );
169 }
170 return t_ulRetVal;
171}
172//-----------------------------------------------------------------------------
177//-----------------------------------------------------------------------------
178#undef SUPER
179//-----------------------------------------------------------------------------
180#endif
Header für Bank
Header für BankAccount
#define SUPER
Definition BankAndCustomerObjCreator.h:48
#define NULL_PTR
Definition EuDef_NULL_PTR.h:74
Header für ObjCreator
Header und Source für TAllSet
Header für NaturalPerson
Header für Person
Das Bankkonto eines Bankkunden bei einer Bank.
Definition BankAccount.h:93
Definition BankAndCustomerObjCreator.h:27
static const unsigned long ClassID_Bank
Definition BankAndCustomerObjCreator.h:34
static const unsigned long ClassID_BankAccount
Definition BankAndCustomerObjCreator.h:35
static const unsigned long ClassID_Person
Definition BankAndCustomerObjCreator.h:31
virtual int getPersObject(glo::Persistent *&prNewObject, unsigned long ulClassID) const
Definition BankAndCustomerObjCreator.h:85
static const unsigned long ClassID_glo_Persistent
Definition BankAndCustomerObjCreator.h:30
virtual ~BankAndCustomerObjCreator()
Definition BankAndCustomerObjCreator.h:55
virtual std::string getBaseName() const
Definition BankAndCustomerObjCreator.h:59
static const unsigned long ClassID_LegalEntity
Definition BankAndCustomerObjCreator.h:32
static const unsigned long ClassID_NaturalPerson
Definition BankAndCustomerObjCreator.h:33
virtual bool isKnownClassID(unsigned long ulClassID) const
Definition BankAndCustomerObjCreator.h:64
virtual ObjCreator * getCopy() const
Definition BankAndCustomerObjCreator.h:173
static const unsigned long ClassID_AllClasses
Definition BankAndCustomerObjCreator.h:29
BankAndCustomerObjCreator()
Definition BankAndCustomerObjCreator.h:50
virtual unsigned long getClassID(glo::BaseAllSet *pAllSet) const
Definition BankAndCustomerObjCreator.h:149
Eine Bank oder eine andere Geldverwaltungsorganisation.
Definition Bank.h:90
Eine natürliche Person.
Definition NaturalPerson.h:90
Eine abstrakte Person, aus der sich natürliche und juristische Personen ableiten lassen.
Definition Person.h:91
Ist die Basisklasse von Template-AllSets und dem generischen AllSet.
Definition GloBaseAllSet.h:80
Abstrakte Oberklasse für Instanziierungsfunktionen der persistenten Klassen. Von dieser Klasse wird g...
Definition GloObjCreator.h:71
ObjCreator()
Definition GloObjCreator.h:84
Ein Objekt-ID besteht aus der Klassen-ID, einer Datenbank-ID und der eigentlichen eindeutigen ObjektZ...
Definition GloObjID.h:77
Die Basisklasse der persistenten Klassen. Von dieser Klasse müssen alle persistenten Klassen abgeleit...
Definition GloPersistent.h:235
virtual int setGloAttribute(const AttributeID &rAttributeID, void *pPara)
AllSet, welcher Objekte aus der Datenbank liefert.
Definition GloTAllSet.h:185