DBM.cc

00001 
00002 /*
00003  * EyeDB Version 2.8.4 Copyright (c) 1995-2006 SYSRA
00004  *
00005  * File 'DBM.cc'
00006  *
00007  * Package Name 'DBM'
00008  *
00009  * Generated by eyedbodl at Fri Jan 18 22:13:24 2008
00010  *
00011  * ---------------------------------------------------
00012  * -------------- DO NOT EDIT THIS CODE --------------
00013  * ---------------------------------------------------
00014  *
00015  */
00016 
00017 #include <eyedb/eyedb.h>
00018 
00019 #include <eyedb/internals/ObjectPeer.h>
00020 #include <eyedb/internals/ClassPeer.h>
00021 #include <eyedb/internals/kern_const.h>
00022 
00023 #include <eyedb/DBM.h>
00024 
00025 #define min(x,y)((x)<(y)?(x):(y))
00026 
00027 namespace eyedb {
00028 
00029 static eyedb::Bool dynget_error_policy = eyedb::False;
00030 static eyedb::Bool dynset_error_policy = eyedb::True;
00031 static eyedb::Oid nulloid;
00032 static unsigned char nulldata[1];
00033 static eyedb::Bool oid_check = eyedb::True;
00034 static int class_ind;
00035 static eyedb::Database::consapp_t *constructors_x = new eyedb::Database::consapp_t[113];
00036 static eyedb::Object *(*constructors[113])(const eyedb::Object *, eyedb::Bool);
00037 static eyedb::GenHashTable *hash;
00038 #define make_object DBMMakeObject
00039 extern void DBMInit(void);
00040 extern void DBMRelease(void);
00041 extern eyedb::Status DBMSchemaUpdate(eyedb::Database *);
00042 extern eyedb::Status DBMSchemaUpdate(eyedb::Schema *);
00043 
00044 static eyedb::Class *index_Class = new eyedb::Class("index");
00045 
00046 void DBM::init()
00047 {
00048   DBMInit();
00049 }
00050 
00051 void DBM::release()
00052 {
00053   DBMRelease();
00054 }
00055 
00056 eyedb::Status DBM::updateSchema(eyedb::Database *db)
00057 {
00058   return DBMSchemaUpdate(db);
00059 }
00060 
00061 eyedb::Status DBM::updateSchema(eyedb::Schema *m)
00062 {
00063   return DBMSchemaUpdate(m);
00064 }
00065 
00066 static eyedb::EnumClass *SysAccessMode_Class;
00067 static eyedb::EnumClass *DBAccessMode_Class;
00068 static eyedb::EnumClass *UserType_Class;
00069 static eyedb::StructClass *UserEntry_Class;
00070 static eyedb::StructClass *DBUserAccess_Class;
00071 static eyedb::StructClass *SysUserAccess_Class;
00072 static eyedb::StructClass *DBEntry_Class;
00073 static eyedb::StructClass *DBPropertyValue_Class;
00074 static eyedb::StructClass *DBProperty_Class;
00075 
00076 static eyedb::Size SysAccessMode_idr_objsz, SysAccessMode_idr_psize;
00077 
00078 static eyedb::EnumClass *SysAccessMode_make(eyedb::EnumClass *SysAccessMode_class = 0, eyedb::Schema *m = 0)
00079 {
00080   if (!SysAccessMode_class)
00081     return new eyedb::EnumClass("system_access_mode");
00082   eyedb::EnumItem *en[7];
00083   en[0] = new eyedb::EnumItem("NO_SYSACCESS_MODE", "NoSysAccessMode", (unsigned int)0);
00084   en[1] = new eyedb::EnumItem("DB_CREATE_SYSACCESS_MODE", "DBCreateSysAccessMode", (unsigned int)256);
00085   en[2] = new eyedb::EnumItem("ADD_USER_SYSACCESS_MODE", "AddUserSysAccessMode", (unsigned int)512);
00086   en[3] = new eyedb::EnumItem("DELETE_USER_SYSACCESS_MODE", "DeleteUserSysAccessMode", (unsigned int)1024);
00087   en[4] = new eyedb::EnumItem("SET_USER_PASSWD_SYSACCESS_MODE", "SetUserPasswdSysAccessMode", (unsigned int)2048);
00088   en[5] = new eyedb::EnumItem("ADMIN_SYSACCESS_MODE", "AdminSysAccessMode", (unsigned int)768);
00089   en[6] = new eyedb::EnumItem("SUPERUSER_SYSACCESS_MODE", "SuperUserSysAccessMode", (unsigned int)4095);
00090 
00091   SysAccessMode_class->setEnumItems(en, 7);
00092 
00093   delete en[0];
00094   delete en[1];
00095   delete en[2];
00096   delete en[3];
00097   delete en[4];
00098   delete en[5];
00099   delete en[6];
00100 
00101 
00102   return SysAccessMode_class;
00103 }
00104 
00105 static void SysAccessMode_init_p()
00106 {
00107   SysAccessMode_Class = SysAccessMode_make();
00108 }
00109 
00110 static void SysAccessMode_init()
00111 {
00112   SysAccessMode_make(SysAccessMode_Class);
00113 
00114   SysAccessMode_idr_objsz = SysAccessMode_Class->getIDRObjectSize(&SysAccessMode_idr_psize, 0);
00115 
00116   eyedb::ObjectPeer::setUnrealizable(SysAccessMode_Class, eyedb::True);
00117 }
00118 
00119 static eyedb::Size DBAccessMode_idr_objsz, DBAccessMode_idr_psize;
00120 
00121 static eyedb::EnumClass *DBAccessMode_make(eyedb::EnumClass *DBAccessMode_class = 0, eyedb::Schema *m = 0)
00122 {
00123   if (!DBAccessMode_class)
00124     return new eyedb::EnumClass("database_access_mode");
00125   eyedb::EnumItem *en[8];
00126   en[0] = new eyedb::EnumItem("NO_DBACCESS_MODE", "NoDBAccessMode", (unsigned int)0);
00127   en[1] = new eyedb::EnumItem("READ_DBACCESS_MODE", "ReadDBAccessMode", (unsigned int)16);
00128   en[2] = new eyedb::EnumItem("WRITE_DBACCESS_MODE", "WriteDBAccessMode", (unsigned int)32);
00129   en[3] = new eyedb::EnumItem("EXEC_DBACCESS_MODE", "ExecDBAccessMode", (unsigned int)64);
00130   en[4] = new eyedb::EnumItem("READ_WRITE_DBACCESS_MODE", "ReadWriteDBAccessMode", (unsigned int)48);
00131   en[5] = new eyedb::EnumItem("READ_EXEC_DBACCESS_MODE", "ReadExecDBAccessMode", (unsigned int)80);
00132   en[6] = new eyedb::EnumItem("READ_WRITE_EXEC_DBACCESS_MODE", "ReadWriteExecDBAccessMode", (unsigned int)112);
00133   en[7] = new eyedb::EnumItem("ADMIN_DBACCESS_MODE", "AdminDBAccessMode", (unsigned int)113);
00134 
00135   DBAccessMode_class->setEnumItems(en, 8);
00136 
00137   delete en[0];
00138   delete en[1];
00139   delete en[2];
00140   delete en[3];
00141   delete en[4];
00142   delete en[5];
00143   delete en[6];
00144   delete en[7];
00145 
00146 
00147   return DBAccessMode_class;
00148 }
00149 
00150 static void DBAccessMode_init_p()
00151 {
00152   DBAccessMode_Class = DBAccessMode_make();
00153 }
00154 
00155 static void DBAccessMode_init()
00156 {
00157   DBAccessMode_make(DBAccessMode_Class);
00158 
00159   DBAccessMode_idr_objsz = DBAccessMode_Class->getIDRObjectSize(&DBAccessMode_idr_psize, 0);
00160 
00161   eyedb::ObjectPeer::setUnrealizable(DBAccessMode_Class, eyedb::True);
00162 }
00163 
00164 static eyedb::Size UserType_idr_objsz, UserType_idr_psize;
00165 
00166 static eyedb::EnumClass *UserType_make(eyedb::EnumClass *UserType_class = 0, eyedb::Schema *m = 0)
00167 {
00168   if (!UserType_class)
00169     return new eyedb::EnumClass("user_type");
00170   eyedb::EnumItem *en[3];
00171   en[0] = new eyedb::EnumItem("EYEDB_USER", "EyeDBUser", (unsigned int)1);
00172   en[1] = new eyedb::EnumItem("UNIX_USER", "UnixUser", (unsigned int)2);
00173   en[2] = new eyedb::EnumItem("STRICT_UNIX_USER", "StrictUnixUser", (unsigned int)3);
00174 
00175   UserType_class->setEnumItems(en, 3);
00176 
00177   delete en[0];
00178   delete en[1];
00179   delete en[2];
00180 
00181 
00182   return UserType_class;
00183 }
00184 
00185 static void UserType_init_p()
00186 {
00187   UserType_Class = UserType_make();
00188 }
00189 
00190 static void UserType_init()
00191 {
00192   UserType_make(UserType_Class);
00193 
00194   UserType_idr_objsz = UserType_Class->getIDRObjectSize(&UserType_idr_psize, 0);
00195 
00196   eyedb::ObjectPeer::setUnrealizable(UserType_Class, eyedb::True);
00197 }
00198 
00199 static const eyedb::Attribute **UserEntry_agritems;
00200 static eyedb::Size UserEntry_idr_objsz, UserEntry_idr_psize;
00201 
00202 static eyedb::StructClass *UserEntry_make(eyedb::StructClass *UserEntry_class = 0, eyedb::Schema *m = 0)
00203 {
00204   if (!UserEntry_class)
00205     return new eyedb::StructClass("user_entry", (m ? m->getClass("struct") : eyedb::Struct_Class));
00206   eyedb::Attribute *attr[6];
00207   int *dims;
00208 
00209   dims = new int[1];
00210   dims[0] = -1;
00211   attr[2] = new eyedb::Attribute((m ? m->getClass("char") : eyedb::Char_Class), "name", eyedb::False, 1, dims);
00212   delete[] dims;
00213 
00214   dims = new int[1];
00215   dims[0] = -1;
00216   attr[3] = new eyedb::Attribute((m ? m->getClass("char") : eyedb::Char_Class), "passwd", eyedb::False, 1, dims);
00217   delete[] dims;
00218 
00219   dims = 0;
00220   attr[4] = new eyedb::Attribute((m ? m->getClass("int") : eyedb::Int32_Class), "uid", eyedb::False, 0, dims);
00221 
00222   dims = 0;
00223   attr[5] = new eyedb::Attribute((m ? m->getClass("user_type") : UserType_Class), "type", eyedb::False, 0, dims);
00224 
00225   UserEntry_class->setAttributes(&attr[2], 4);
00226 
00227   delete attr[2];
00228   delete attr[3];
00229   delete attr[4];
00230   delete attr[5];
00231 
00232 
00233   return UserEntry_class;
00234 }
00235 
00236 eyedb::Object *UserEntry_construct_x(const eyedb::Class *cls, eyedb::Data idr)
00237 {
00238   return new UserEntry(cls, idr);
00239 }
00240 
00241 eyedb::Object *UserEntry_construct(const eyedb::Object *o, eyedb::Bool share)
00242 {
00243   return new UserEntry((const eyedb::Struct *)o, share);
00244 }
00245 
00246 static void UserEntry_init_p()
00247 {
00248   UserEntry_Class = UserEntry_make();
00249   constructors_x[class_ind] = UserEntry_construct_x;
00250   constructors[class_ind] = UserEntry_construct;
00251   hash->insert("user_entry", class_ind++);
00252 }
00253 
00254 static void UserEntry_init()
00255 {
00256   UserEntry_make(UserEntry_Class);
00257 
00258   UserEntry_agritems = UserEntry_Class->getAttributes();
00259   UserEntry_idr_objsz = UserEntry_Class->getIDRObjectSize(&UserEntry_idr_psize, 0);
00260 
00261   eyedb::ObjectPeer::setUnrealizable(UserEntry_Class, eyedb::True);
00262 }
00263 
00264 static eyedb::Status UserEntry_attrcomp_realize(eyedb::Database *db, eyedb::Class *cls)
00265 {
00266   eyedb::AttributeComponent *comp;
00267   const eyedb::Dataspace *dataspace;
00268   eyedb::ClassComponent *clcomp;
00269   eyedb::Status status;
00270   int *impl_hints;
00271   comp = new eyedb::UniqueConstraint(db, cls, "user_entry.name", eyedb::True);
00272   cls->add(comp->getInd(), comp);
00273 
00274   impl_hints = new int[8];
00275   impl_hints[0] = 0;
00276   impl_hints[1] = 0;
00277   impl_hints[2] = 0;
00278   impl_hints[3] = 0;
00279   impl_hints[4] = 0;
00280   impl_hints[5] = 0;
00281   impl_hints[6] = 0;
00282   impl_hints[7] = 0;
00283   dataspace = 0;;
00284   comp = new eyedb::HashIndex(db, cls, "user_entry.name", eyedb::True, eyedb::True, dataspace, 0, 0, impl_hints, 8);
00285   delete [] impl_hints;
00286   cls->add(comp->getInd(), comp);
00287 
00288   impl_hints = new int[8];
00289   impl_hints[0] = 0;
00290   impl_hints[1] = 0;
00291   impl_hints[2] = 0;
00292   impl_hints[3] = 0;
00293   impl_hints[4] = 0;
00294   impl_hints[5] = 0;
00295   impl_hints[6] = 0;
00296   impl_hints[7] = 0;
00297   dataspace = 0;;
00298   comp = new eyedb::BTreeIndex(db, cls, "user_entry.uid", eyedb::True, eyedb::False, dataspace, 0, impl_hints, 8);
00299   delete [] impl_hints;
00300   cls->add(comp->getInd(), comp);
00301 
00302   return eyedb::Success;
00303 }
00304 
00305 UserEntry::UserEntry(eyedb::Database *_db, const eyedb::Dataspace *_dataspace) : eyedb::Struct(_db, _dataspace)
00306 {
00307   initialize(_db);
00308 }
00309 
00310 UserEntry::UserEntry(const eyedb::Class *_cls, eyedb::Data _idr)
00311 {
00312   setClass((eyedb::Class *)_cls);
00313 
00314   eyedb::Size idr_psize;
00315   eyedb::Size idr_tsize = getClass()->getIDRObjectSize(&idr_psize);
00316   if (_idr)
00317     idr->setIDR(idr_tsize, _idr);
00318   else
00319     {
00320       idr->setIDR(idr_tsize);
00321       memset(idr->getIDR() + IDB_OBJ_HEAD_SIZE, 0, idr->getSize() - IDB_OBJ_HEAD_SIZE);
00322     }
00323   headerCode(eyedb::_Struct_Type, idr_psize, IDB_XINFO_LOCAL_OBJ);
00324   eyedb::ClassPeer::newObjRealize(getClass(), this);
00325   eyedb::ObjectPeer::setGRTObject(this, eyedb::True);
00326   userInitialize();
00327 }
00328 
00329 void UserEntry::initialize(eyedb::Database *_db)
00330 {
00331   setClass((_db ? _db->getSchema()->getClass("user_entry") : UserEntry_Class));
00332 
00333   eyedb::Size idr_psize;
00334   idr->setIDR(getClass()->getIDRObjectSize(&idr_psize));
00335   memset(idr->getIDR() + IDB_OBJ_HEAD_SIZE, 0, idr->getSize() - IDB_OBJ_HEAD_SIZE);
00336   headerCode(eyedb::_Struct_Type, idr_psize, IDB_XINFO_LOCAL_OBJ);
00337   eyedb::ClassPeer::newObjRealize(getClass(), this);
00338   eyedb::ObjectPeer::setGRTObject(this, eyedb::True);
00339   userInitialize();
00340 }
00341 
00342 UserEntry::UserEntry(const UserEntry& x) : eyedb::Struct(x)
00343 {
00344   userCopy(x);
00345 }
00346 
00347 UserEntry& UserEntry::operator=(const UserEntry& x)
00348 {
00349   *(eyedb::Struct *)this = eyedb::Struct::operator=((const eyedb::Struct &)x);
00350   userCopy(x);
00351   return *this;
00352 }
00353 
00354 UserEntry::UserEntry(const eyedb::Struct *x, eyedb::Bool share) : eyedb::Struct(x, share)
00355 {
00356   setClass((db ? db->getSchema()->getClass("user_entry") : UserEntry_Class));
00357 
00358   eyedb::Size idr_psize;
00359   getClass()->getIDRObjectSize(&idr_psize);
00360   if (!share)
00361     {
00362       headerCode(eyedb::_Struct_Type, idr_psize, IDB_XINFO_LOCAL_OBJ);
00363       eyedb::ClassPeer::newObjRealize(getClass(), this);
00364     }
00365 
00366   eyedb::ObjectPeer::setGRTObject(this, eyedb::True);
00367   userCopy(*x);
00368 }
00369 
00370 UserEntry::UserEntry(const UserEntry *x, eyedb::Bool share) : eyedb::Struct(x, share)
00371 {
00372   setClass((db ? db->getSchema()->getClass("user_entry") : UserEntry_Class));
00373 
00374   eyedb::Size idr_psize;
00375   getClass()->getIDRObjectSize(&idr_psize);
00376   if (!share)
00377     {
00378       headerCode(eyedb::_Struct_Type, idr_psize, IDB_XINFO_LOCAL_OBJ);
00379       eyedb::ClassPeer::newObjRealize(getClass(), this);
00380     }
00381 
00382   eyedb::ObjectPeer::setGRTObject(this, eyedb::True);
00383   userCopy(*x);
00384 }
00385 
00386 eyedb::Status UserEntry::name(const std::string &_name)
00387 {
00388   eyedb::gbxAutoGarbSuspender _gbxsusp_;
00389   eyedb::Status status;
00390   eyedb::Size size;
00391   eyedb::Size len = _name.size() + 1;
00392 
00393   status = getClass()->getAttributes()[2]->getSize(this, size);
00394   if (status)
00395     return status;
00396 
00397   if (size != len)
00398     status = getClass()->getAttributes()[2]->setSize(this, len);
00399   if (status)
00400     return status;
00401 
00402   status = getClass()->getAttributes()[2]->setValue(this, (eyedb::Data)_name.c_str(), len, 0);
00403   return status;
00404 
00405 }
00406 
00407 eyedb::Status UserEntry::name(unsigned int a0, char _name)
00408 {
00409   eyedb::gbxAutoGarbSuspender _gbxsusp_;
00410   eyedb::Status status;
00411   eyedb::Size from = a0;
00412 
00413   eyedb::Size size;
00414   status = getClass()->getAttributes()[2]->getSize(this, size);
00415   if (status)
00416     return status;
00417 
00418   if (size <= from)
00419     status = getClass()->getAttributes()[2]->setSize(this, from+1);
00420   if (status)
00421     return status;
00422 
00423   status = getClass()->getAttributes()[2]->setValue(this, (eyedb::Data)&_name, 1, from);
00424   return status;
00425 }
00426 
00427 std::string UserEntry::name(eyedb::Bool *isnull, eyedb::Status *rs) const
00428 {
00429   eyedb::gbxAutoGarbSuspender _gbxsusp_;
00430   eyedb::Data data;
00431   eyedb::Status s;
00432 
00433   s = getClass()->getAttributes()[2]->getValue(this, (eyedb::Data *)&data, eyedb::Attribute::directAccess, 0, isnull);
00434   if (s) {if (rs) *rs = s; return 0;}
00435   if (!data) data = nulldata;
00436   return (const char *)data;
00437 }
00438 
00439 char UserEntry::name(unsigned int a0, eyedb::Bool *isnull, eyedb::Status *rs) const
00440 {
00441   eyedb::gbxAutoGarbSuspender _gbxsusp_;
00442   char __tmp = 0;
00443   eyedb::Status s;
00444   eyedb::Size from = a0;
00445 
00446   s = getClass()->getAttributes()[2]->getValue(this, (eyedb::Data *)&__tmp, 1, from, isnull);
00447   if (s) {if (rs) *rs = s; return 0;}
00448   return __tmp;
00449 }
00450 
00451 eyedb::Status UserEntry::passwd(const std::string &_passwd)
00452 {
00453   eyedb::gbxAutoGarbSuspender _gbxsusp_;
00454   eyedb::Status status;
00455   eyedb::Size size;
00456   eyedb::Size len = _passwd.size() + 1;
00457 
00458   status = getClass()->getAttributes()[3]->getSize(this, size);
00459   if (status)
00460     return status;
00461 
00462   if (size != len)
00463     status = getClass()->getAttributes()[3]->setSize(this, len);
00464   if (status)
00465     return status;
00466 
00467   status = getClass()->getAttributes()[3]->setValue(this, (eyedb::Data)_passwd.c_str(), len, 0);
00468   return status;
00469 
00470 }
00471 
00472 eyedb::Status UserEntry::passwd(unsigned int a0, char _passwd)
00473 {
00474   eyedb::gbxAutoGarbSuspender _gbxsusp_;
00475   eyedb::Status status;
00476   eyedb::Size from = a0;
00477 
00478   eyedb::Size size;
00479   status = getClass()->getAttributes()[3]->getSize(this, size);
00480   if (status)
00481     return status;
00482 
00483   if (size <= from)
00484     status = getClass()->getAttributes()[3]->setSize(this, from+1);
00485   if (status)
00486     return status;
00487 
00488   status = getClass()->getAttributes()[3]->setValue(this, (eyedb::Data)&_passwd, 1, from);
00489   return status;
00490 }
00491 
00492 std::string UserEntry::passwd(eyedb::Bool *isnull, eyedb::Status *rs) const
00493 {
00494   eyedb::gbxAutoGarbSuspender _gbxsusp_;
00495   eyedb::Data data;
00496   eyedb::Status s;
00497 
00498   s = getClass()->getAttributes()[3]->getValue(this, (eyedb::Data *)&data, eyedb::Attribute::directAccess, 0, isnull);
00499   if (s) {if (rs) *rs = s; return 0;}
00500   if (!data) data = nulldata;
00501   return (const char *)data;
00502 }
00503 
00504 char UserEntry::passwd(unsigned int a0, eyedb::Bool *isnull, eyedb::Status *rs) const
00505 {
00506   eyedb::gbxAutoGarbSuspender _gbxsusp_;
00507   char __tmp = 0;
00508   eyedb::Status s;
00509   eyedb::Size from = a0;
00510 
00511   s = getClass()->getAttributes()[3]->getValue(this, (eyedb::Data *)&__tmp, 1, from, isnull);
00512   if (s) {if (rs) *rs = s; return 0;}
00513   return __tmp;
00514 }
00515 
00516 eyedb::Status UserEntry::uid(eyedblib::int32 _uid)
00517 {
00518   eyedb::gbxAutoGarbSuspender _gbxsusp_;
00519   eyedb::Status status;
00520 
00521   status = getClass()->getAttributes()[4]->setValue(this, (eyedb::Data)&_uid, 1, 0);
00522   return status;
00523 }
00524 
00525 eyedblib::int32 UserEntry::uid(eyedb::Bool *isnull, eyedb::Status *rs) const
00526 {
00527   eyedb::gbxAutoGarbSuspender _gbxsusp_;
00528   eyedblib::int32 __tmp = 0;
00529   eyedb::Status s;
00530 
00531   s = getClass()->getAttributes()[4]->getValue(this, (eyedb::Data *)&__tmp, 1, 0, isnull);
00532   if (s) {if (rs) *rs = s; return 0;}
00533   return __tmp;
00534 }
00535 
00536 eyedb::Status UserEntry::type(UserType _type, eyedb::Bool _check_value)
00537 {
00538   eyedb::gbxAutoGarbSuspender _gbxsusp_;
00539   eyedb::Status status;
00540   eyedblib::int32 __tmp = _type;
00541 
00542   status = getClass()->getAttributes()[5]->setValue(this, (eyedb::Data)&__tmp, 1, 0, _check_value);
00543   return status;
00544 }
00545 
00546 UserType UserEntry::type(eyedb::Bool *isnull, eyedb::Status *rs) const
00547 {
00548   eyedb::gbxAutoGarbSuspender _gbxsusp_;
00549   eyedblib::int32  __tmp = 0;
00550   eyedb::Status s;
00551 
00552   s = getClass()->getAttributes()[5]->getValue(this, (eyedb::Data *)&__tmp, 1, 0, isnull);
00553   if (s) {if (rs) *rs = s; return (UserType)0;}
00554   return (UserType)__tmp;
00555 }
00556 
00557 static const eyedb::Attribute **DBUserAccess_agritems;
00558 static eyedb::Size DBUserAccess_idr_objsz, DBUserAccess_idr_psize;
00559 
00560 static eyedb::StructClass *DBUserAccess_make(eyedb::StructClass *DBUserAccess_class = 0, eyedb::Schema *m = 0)
00561 {
00562   if (!DBUserAccess_class)
00563     return new eyedb::StructClass("database_user_access", (m ? m->getClass("struct") : eyedb::Struct_Class));
00564   eyedb::Attribute *attr[5];
00565   int *dims;
00566 
00567   dims = 0;
00568   attr[2] = new eyedb::Attribute((m ? m->getClass("database_entry") : DBEntry_Class), "dbentry", eyedb::True, 0, dims);
00569 
00570   dims = 0;
00571   attr[3] = new eyedb::Attribute((m ? m->getClass("user_entry") : UserEntry_Class), "user", eyedb::True, 0, dims);
00572 
00573   dims = 0;
00574   attr[4] = new eyedb::Attribute((m ? m->getClass("database_access_mode") : DBAccessMode_Class), "mode", eyedb::False, 0, dims);
00575 
00576   DBUserAccess_class->setAttributes(&attr[2], 3);
00577 
00578   delete attr[2];
00579   delete attr[3];
00580   delete attr[4];
00581 
00582 
00583   return DBUserAccess_class;
00584 }
00585 
00586 eyedb::Object *DBUserAccess_construct_x(const eyedb::Class *cls, eyedb::Data idr)
00587 {
00588   return new DBUserAccess(cls, idr);
00589 }
00590 
00591 eyedb::Object *DBUserAccess_construct(const eyedb::Object *o, eyedb::Bool share)
00592 {
00593   return new DBUserAccess((const eyedb::Struct *)o, share);
00594 }
00595 
00596 static void DBUserAccess_init_p()
00597 {
00598   DBUserAccess_Class = DBUserAccess_make();
00599   constructors_x[class_ind] = DBUserAccess_construct_x;
00600   constructors[class_ind] = DBUserAccess_construct;
00601   hash->insert("database_user_access", class_ind++);
00602 }
00603 
00604 static void DBUserAccess_init()
00605 {
00606   DBUserAccess_make(DBUserAccess_Class);
00607 
00608   DBUserAccess_agritems = DBUserAccess_Class->getAttributes();
00609   DBUserAccess_idr_objsz = DBUserAccess_Class->getIDRObjectSize(&DBUserAccess_idr_psize, 0);
00610 
00611   eyedb::ObjectPeer::setUnrealizable(DBUserAccess_Class, eyedb::True);
00612 }
00613 
00614 static eyedb::Status DBUserAccess_attrcomp_realize(eyedb::Database *db, eyedb::Class *cls)
00615 {
00616   eyedb::AttributeComponent *comp;
00617   const eyedb::Dataspace *dataspace;
00618   eyedb::ClassComponent *clcomp;
00619   eyedb::Status status;
00620   int *impl_hints;
00621   impl_hints = new int[8];
00622   impl_hints[0] = 0;
00623   impl_hints[1] = 0;
00624   impl_hints[2] = 0;
00625   impl_hints[3] = 0;
00626   impl_hints[4] = 0;
00627   impl_hints[5] = 0;
00628   impl_hints[6] = 0;
00629   impl_hints[7] = 0;
00630   dataspace = 0;;
00631   comp = new eyedb::HashIndex(db, cls, "database_user_access.dbentry", eyedb::True, eyedb::False, dataspace, 0, 0, impl_hints, 8);
00632   delete [] impl_hints;
00633   cls->add(comp->getInd(), comp);
00634 
00635   impl_hints = new int[8];
00636   impl_hints[0] = 0;
00637   impl_hints[1] = 0;
00638   impl_hints[2] = 0;
00639   impl_hints[3] = 0;
00640   impl_hints[4] = 0;
00641   impl_hints[5] = 0;
00642   impl_hints[6] = 0;
00643   impl_hints[7] = 0;
00644   dataspace = 0;;
00645   comp = new eyedb::HashIndex(db, cls, "database_user_access.user", eyedb::True, eyedb::False, dataspace, 0, 0, impl_hints, 8);
00646   delete [] impl_hints;
00647   cls->add(comp->getInd(), comp);
00648 
00649   return eyedb::Success;
00650 }
00651 
00652 DBUserAccess::DBUserAccess(eyedb::Database *_db, const eyedb::Dataspace *_dataspace) : eyedb::Struct(_db, _dataspace)
00653 {
00654   initialize(_db);
00655 }
00656 
00657 DBUserAccess::DBUserAccess(const eyedb::Class *_cls, eyedb::Data _idr)
00658 {
00659   setClass((eyedb::Class *)_cls);
00660 
00661   eyedb::Size idr_psize;
00662   eyedb::Size idr_tsize = getClass()->getIDRObjectSize(&idr_psize);
00663   if (_idr)
00664     idr->setIDR(idr_tsize, _idr);
00665   else
00666     {
00667       idr->setIDR(idr_tsize);
00668       memset(idr->getIDR() + IDB_OBJ_HEAD_SIZE, 0, idr->getSize() - IDB_OBJ_HEAD_SIZE);
00669     }
00670   headerCode(eyedb::_Struct_Type, idr_psize, IDB_XINFO_LOCAL_OBJ);
00671   eyedb::ClassPeer::newObjRealize(getClass(), this);
00672   eyedb::ObjectPeer::setGRTObject(this, eyedb::True);
00673   userInitialize();
00674 }
00675 
00676 void DBUserAccess::initialize(eyedb::Database *_db)
00677 {
00678   setClass((_db ? _db->getSchema()->getClass("database_user_access") : DBUserAccess_Class));
00679 
00680   eyedb::Size idr_psize;
00681   idr->setIDR(getClass()->getIDRObjectSize(&idr_psize));
00682   memset(idr->getIDR() + IDB_OBJ_HEAD_SIZE, 0, idr->getSize() - IDB_OBJ_HEAD_SIZE);
00683   headerCode(eyedb::_Struct_Type, idr_psize, IDB_XINFO_LOCAL_OBJ);
00684   eyedb::ClassPeer::newObjRealize(getClass(), this);
00685   eyedb::ObjectPeer::setGRTObject(this, eyedb::True);
00686   userInitialize();
00687 }
00688 
00689 DBUserAccess::DBUserAccess(const DBUserAccess& x) : eyedb::Struct(x)
00690 {
00691   userCopy(x);
00692 }
00693 
00694 DBUserAccess& DBUserAccess::operator=(const DBUserAccess& x)
00695 {
00696   *(eyedb::Struct *)this = eyedb::Struct::operator=((const eyedb::Struct &)x);
00697   userCopy(x);
00698   return *this;
00699 }
00700 
00701 DBUserAccess::DBUserAccess(const eyedb::Struct *x, eyedb::Bool share) : eyedb::Struct(x, share)
00702 {
00703   setClass((db ? db->getSchema()->getClass("database_user_access") : DBUserAccess_Class));
00704 
00705   eyedb::Size idr_psize;
00706   getClass()->getIDRObjectSize(&idr_psize);
00707   if (!share)
00708     {
00709       headerCode(eyedb::_Struct_Type, idr_psize, IDB_XINFO_LOCAL_OBJ);
00710       eyedb::ClassPeer::newObjRealize(getClass(), this);
00711     }
00712 
00713   eyedb::ObjectPeer::setGRTObject(this, eyedb::True);
00714   userCopy(*x);
00715 }
00716 
00717 DBUserAccess::DBUserAccess(const DBUserAccess *x, eyedb::Bool share) : eyedb::Struct(x, share)
00718 {
00719   setClass((db ? db->getSchema()->getClass("database_user_access") : DBUserAccess_Class));
00720 
00721   eyedb::Size idr_psize;
00722   getClass()->getIDRObjectSize(&idr_psize);
00723   if (!share)
00724     {
00725       headerCode(eyedb::_Struct_Type, idr_psize, IDB_XINFO_LOCAL_OBJ);
00726       eyedb::ClassPeer::newObjRealize(getClass(), this);
00727     }
00728 
00729   eyedb::ObjectPeer::setGRTObject(this, eyedb::True);
00730   userCopy(*x);
00731 }
00732 
00733 eyedb::Status DBUserAccess::dbentry(DBEntry*_dbentry)
00734 {
00735   eyedb::gbxAutoGarbSuspender _gbxsusp_;
00736   eyedb::Status status;
00737 
00738   eyedb::Object *_odbentry = _dbentry;
00739 
00740   status = getClass()->getAttributes()[2]->setValue(this, (eyedb::Data)&_odbentry, 1, 0);
00741   return status;
00742 }
00743 
00744 const DBEntry*DBUserAccess::dbentry(eyedb::Bool *isnull, eyedb::Status *rs) const 
00745 {
00746   eyedb::gbxAutoGarbSuspender _gbxsusp_;
00747   eyedb::Object *__o = 0, *__go;
00748   eyedb::Status s;
00749 
00750   s = getClass()->getAttributes()[2]->getValue(this, (eyedb::Data *)&__o, 1, 0, isnull);
00751   if (s) {if (rs) *rs = s; return 0;}
00752 
00753   if (__o)
00754     {
00755      if (eyedb::ObjectPeer::isGRTObject(__o)) {
00756        return (DBEntry *)__o;
00757      }
00758      __go = (DBEntry *)make_object(__o, eyedb::False);
00759      if (__go)
00760       {
00761        __o = __go;
00762        s = getClass()->getAttributes()[2]->setValue((Agregat *)this, (eyedb::Data)&__o, 1, 0);
00763        eyedb::ObjectPeer::decrRefCount(__o);
00764        if (s) {if (rs) *rs = s; return 0;}
00765       }
00766      return (DBEntry*)__o;
00767     }
00768 
00769   eyedb::Bool wasnull = (!__o ? eyedb::True : eyedb::False);
00770   if (!__o && db)
00771     {
00772       eyedb::Oid toid;
00773       s = getClass()->getAttributes()[2]->getOid(this, &toid, 1, 0);
00774       if (s) {if (rs) *rs = s; return 0;}
00775       if (toid.isValid())
00776         {
00777           s = db->loadObject(&toid, &__o);
00778           if (s) {if (rs) *rs = s; return 0;}
00779           if (!eyedb::ObjectPeer::isGRTObject(__o))
00780            {
00781              __go = (DBEntry *)make_object(__o, eyedb::False);
00782              if (__go) __o = __go;
00783            }
00784         }
00785     }
00786 
00787   if (__o && wasnull)
00788     {
00789      s = getClass()->getAttributes()[2]->setValue((eyedb::Agregat *)this, (eyedb::Data)&__o, 1, 0);
00790      if (s) {if (rs) *rs = s; return 0;}
00791      __o->release();
00792     }
00793   return (DBEntry*)__o;
00794 }
00795 
00796 DBEntry*DBUserAccess::dbentry(eyedb::Bool *isnull, eyedb::Status *rs) 
00797 {
00798   eyedb::gbxAutoGarbSuspender _gbxsusp_;
00799   eyedb::Object *__o = 0, *__go;
00800   eyedb::Status s;
00801 
00802   s = getClass()->getAttributes()[2]->getValue(this, (eyedb::Data *)&__o, 1, 0, isnull);
00803   if (s) {if (rs) *rs = s; return 0;}
00804 
00805   if (__o)
00806     {
00807      if (eyedb::ObjectPeer::isGRTObject(__o)) {
00808        return (DBEntry *)__o;
00809      }
00810      __go = (DBEntry *)make_object(__o, eyedb::False);
00811      if (__go)
00812       {
00813        __o = __go;
00814        s = getClass()->getAttributes()[2]->setValue((Agregat *)this, (eyedb::Data)&__o, 1, 0);
00815        eyedb::ObjectPeer::decrRefCount(__o);
00816        if (s) {if (rs) *rs = s; return 0;}
00817       }
00818      return (DBEntry*)__o;
00819     }
00820 
00821   eyedb::Bool wasnull = (!__o ? eyedb::True : eyedb::False);
00822   if (!__o && db)
00823     {
00824       eyedb::Oid toid;
00825       s = getClass()->getAttributes()[2]->getOid(this, &toid, 1, 0);
00826       if (s) {if (rs) *rs = s; return 0;}
00827       if (toid.isValid())
00828         {
00829           s = db->loadObject(&toid, &__o);
00830           if (s) {if (rs) *rs = s; return 0;}
00831           if (!eyedb::ObjectPeer::isGRTObject(__o))
00832            {
00833              __go = (DBEntry *)make_object(__o, eyedb::False);
00834              if (__go) __o = __go;
00835            }
00836         }
00837     }
00838 
00839   if (__o && wasnull)
00840     {
00841      s = getClass()->getAttributes()[2]->setValue((eyedb::Agregat *)this, (eyedb::Data)&__o, 1, 0);
00842      if (s) {if (rs) *rs = s; return 0;}
00843      __o->release();
00844     }
00845   return (DBEntry*)__o;
00846 }
00847 
00848 eyedb::Status DBUserAccess::dbentry_oid(const eyedb::Oid &_oid)
00849 {
00850   eyedb::gbxAutoGarbSuspender _gbxsusp_;
00851   eyedb::Status status;
00852 
00853   status = getClass()->getAttributes()[2]->setOid(this, &_oid, 1, 0, oid_check);
00854   return status;
00855 }
00856 
00857 eyedb::Oid DBUserAccess::dbentry_oid(eyedb::Status *rs) const
00858 {
00859   eyedb::gbxAutoGarbSuspender _gbxsusp_;
00860   eyedb::Oid __tmp;
00861   eyedb::Status s;
00862 
00863   s = getClass()->getAttributes()[2]->getOid(this, &__tmp, 1, 0);
00864   if (s) {if (rs) *rs = s; return nulloid;}
00865 
00866   return __tmp;
00867 }
00868 
00869 eyedb::Status DBUserAccess::user(UserEntry*_user)
00870 {
00871   eyedb::gbxAutoGarbSuspender _gbxsusp_;
00872   eyedb::Status status;
00873 
00874   eyedb::Object *_ouser = _user;
00875 
00876   status = getClass()->getAttributes()[3]->setValue(this, (eyedb::Data)&_ouser, 1, 0);
00877   return status;
00878 }
00879 
00880 const UserEntry*DBUserAccess::user(eyedb::Bool *isnull, eyedb::Status *rs) const 
00881 {
00882   eyedb::gbxAutoGarbSuspender _gbxsusp_;
00883   eyedb::Object *__o = 0, *__go;
00884   eyedb::Status s;
00885 
00886   s = getClass()->getAttributes()[3]->getValue(this, (eyedb::Data *)&__o, 1, 0, isnull);
00887   if (s) {if (rs) *rs = s; return 0;}
00888 
00889   if (__o)
00890     {
00891      if (eyedb::ObjectPeer::isGRTObject(__o)) {
00892        return (UserEntry *)__o;
00893      }
00894      __go = (UserEntry *)make_object(__o, eyedb::False);
00895      if (__go)
00896       {
00897        __o = __go;
00898        s = getClass()->getAttributes()[3]->setValue((Agregat *)this, (eyedb::Data)&__o, 1, 0);
00899        eyedb::ObjectPeer::decrRefCount(__o);
00900        if (s) {if (rs) *rs = s; return 0;}
00901       }
00902      return (UserEntry*)__o;
00903     }
00904 
00905   eyedb::Bool wasnull = (!__o ? eyedb::True : eyedb::False);
00906   if (!__o && db)
00907     {
00908       eyedb::Oid toid;
00909       s = getClass()->getAttributes()[3]->getOid(this, &toid, 1, 0);
00910       if (s) {if (rs) *rs = s; return 0;}
00911       if (toid.isValid())
00912         {
00913           s = db->loadObject(&toid, &__o);
00914           if (s) {if (rs) *rs = s; return 0;}
00915           if (!eyedb::ObjectPeer::isGRTObject(__o))
00916            {
00917              __go = (UserEntry *)make_object(__o, eyedb::False);
00918              if (__go) __o = __go;
00919            }
00920         }
00921     }
00922 
00923   if (__o && wasnull)
00924     {
00925      s = getClass()->getAttributes()[3]->setValue((eyedb::Agregat *)this, (eyedb::Data)&__o, 1, 0);
00926      if (s) {if (rs) *rs = s; return 0;}
00927      __o->release();
00928     }
00929   return (UserEntry*)__o;
00930 }
00931 
00932 UserEntry*DBUserAccess::user(eyedb::Bool *isnull, eyedb::Status *rs) 
00933 {
00934   eyedb::gbxAutoGarbSuspender _gbxsusp_;
00935   eyedb::Object *__o = 0, *__go;
00936   eyedb::Status s;
00937 
00938   s = getClass()->getAttributes()[3]->getValue(this, (eyedb::Data *)&__o, 1, 0, isnull);
00939   if (s) {if (rs) *rs = s; return 0;}
00940 
00941   if (__o)
00942     {
00943      if (eyedb::ObjectPeer::isGRTObject(__o)) {
00944        return (UserEntry *)__o;
00945      }
00946      __go = (UserEntry *)make_object(__o, eyedb::False);
00947      if (__go)
00948       {
00949        __o = __go;
00950        s = getClass()->getAttributes()[3]->setValue((Agregat *)this, (eyedb::Data)&__o, 1, 0);
00951        eyedb::ObjectPeer::decrRefCount(__o);
00952        if (s) {if (rs) *rs = s; return 0;}
00953       }
00954      return (UserEntry*)__o;
00955     }
00956 
00957   eyedb::Bool wasnull = (!__o ? eyedb::True : eyedb::False);
00958   if (!__o && db)
00959     {
00960       eyedb::Oid toid;
00961       s = getClass()->getAttributes()[3]->getOid(this, &toid, 1, 0);
00962       if (s) {if (rs) *rs = s; return 0;}
00963       if (toid.isValid())
00964         {
00965           s = db->loadObject(&toid, &__o);
00966           if (s) {if (rs) *rs = s; return 0;}
00967           if (!eyedb::ObjectPeer::isGRTObject(__o))
00968            {
00969              __go = (UserEntry *)make_object(__o, eyedb::False);
00970              if (__go) __o = __go;
00971            }
00972         }
00973     }
00974 
00975   if (__o && wasnull)
00976     {
00977      s = getClass()->getAttributes()[3]->setValue((eyedb::Agregat *)this, (eyedb::Data)&__o, 1, 0);
00978      if (s) {if (rs) *rs = s; return 0;}
00979      __o->release();
00980     }
00981   return (UserEntry*)__o;
00982 }
00983 
00984 eyedb::Status DBUserAccess::user_oid(const eyedb::Oid &_oid)
00985 {
00986   eyedb::gbxAutoGarbSuspender _gbxsusp_;
00987   eyedb::Status status;
00988 
00989   status = getClass()->getAttributes()[3]->setOid(this, &_oid, 1, 0, oid_check);
00990   return status;
00991 }
00992 
00993 eyedb::Oid DBUserAccess::user_oid(eyedb::Status *rs) const
00994 {
00995   eyedb::gbxAutoGarbSuspender _gbxsusp_;
00996   eyedb::Oid __tmp;
00997   eyedb::Status s;
00998 
00999   s = getClass()->getAttributes()[3]->getOid(this, &__tmp, 1, 0);
01000   if (s) {if (rs) *rs = s; return nulloid;}
01001 
01002   return __tmp;
01003 }
01004 
01005 eyedb::Status DBUserAccess::mode(DBAccessMode _mode, eyedb::Bool _check_value)
01006 {
01007   eyedb::gbxAutoGarbSuspender _gbxsusp_;
01008   eyedb::Status status;
01009   eyedblib::int32 __tmp = _mode;
01010 
01011   status = getClass()->getAttributes()[4]->setValue(this, (eyedb::Data)&__tmp, 1, 0, _check_value);
01012   return status;
01013 }
01014 
01015 DBAccessMode DBUserAccess::mode(eyedb::Bool *isnull, eyedb::Status *rs) const
01016 {
01017   eyedb::gbxAutoGarbSuspender _gbxsusp_;
01018   eyedblib::int32  __tmp = 0;
01019   eyedb::Status s;
01020 
01021   s = getClass()->getAttributes()[4]->getValue(this, (eyedb::Data *)&__tmp, 1, 0, isnull);
01022   if (s) {if (rs) *rs = s; return (DBAccessMode)0;}
01023   return (DBAccessMode)__tmp;
01024 }
01025 
01026 static const eyedb::Attribute **SysUserAccess_agritems;
01027 static eyedb::Size SysUserAccess_idr_objsz, SysUserAccess_idr_psize;
01028 
01029 static eyedb::StructClass *SysUserAccess_make(eyedb::StructClass *SysUserAccess_class = 0, eyedb::Schema *m = 0)
01030 {
01031   if (!SysUserAccess_class)
01032     return new eyedb::StructClass("system_user_access", (m ? m->getClass("struct") : eyedb::Struct_Class));
01033   eyedb::Attribute *attr[4];
01034   int *dims;
01035 
01036   dims = 0;
01037   attr[2] = new eyedb::Attribute((m ? m->getClass("user_entry") : UserEntry_Class), "user", eyedb::True, 0, dims);
01038 
01039   dims = 0;
01040   attr[3] = new eyedb::Attribute((m ? m->getClass("system_access_mode") : SysAccessMode_Class), "mode", eyedb::False, 0, dims);
01041 
01042   SysUserAccess_class->setAttributes(&attr[2], 2);
01043 
01044   delete attr[2];
01045   delete attr[3];
01046 
01047 
01048   return SysUserAccess_class;
01049 }
01050 
01051 eyedb::Object *SysUserAccess_construct_x(const eyedb::Class *cls, eyedb::Data idr)
01052 {
01053   return new SysUserAccess(cls, idr);
01054 }
01055 
01056 eyedb::Object *SysUserAccess_construct(const eyedb::Object *o, eyedb::Bool share)
01057 {
01058   return new SysUserAccess((const eyedb::Struct *)o, share);
01059 }
01060 
01061 static void SysUserAccess_init_p()
01062 {
01063   SysUserAccess_Class = SysUserAccess_make();
01064   constructors_x[class_ind] = SysUserAccess_construct_x;
01065   constructors[class_ind] = SysUserAccess_construct;
01066   hash->insert("system_user_access", class_ind++);
01067 }
01068 
01069 static void SysUserAccess_init()
01070 {
01071   SysUserAccess_make(SysUserAccess_Class);
01072 
01073   SysUserAccess_agritems = SysUserAccess_Class->getAttributes();
01074   SysUserAccess_idr_objsz = SysUserAccess_Class->getIDRObjectSize(&SysUserAccess_idr_psize, 0);
01075 
01076   eyedb::ObjectPeer::setUnrealizable(SysUserAccess_Class, eyedb::True);
01077 }
01078 
01079 static eyedb::Status SysUserAccess_attrcomp_realize(eyedb::Database *db, eyedb::Class *cls)
01080 {
01081   eyedb::AttributeComponent *comp;
01082   const eyedb::Dataspace *dataspace;
01083   eyedb::ClassComponent *clcomp;
01084   eyedb::Status status;
01085   int *impl_hints;
01086   impl_hints = new int[8];
01087   impl_hints[0] = 0;
01088   impl_hints[1] = 0;
01089   impl_hints[2] = 0;
01090   impl_hints[3] = 0;
01091   impl_hints[4] = 0;
01092   impl_hints[5] = 0;
01093   impl_hints[6] = 0;
01094   impl_hints[7] = 0;
01095   dataspace = 0;;
01096   comp = new eyedb::HashIndex(db, cls, "system_user_access.user", eyedb::True, eyedb::False, dataspace, 0, 0, impl_hints, 8);
01097   delete [] impl_hints;
01098   cls->add(comp->getInd(), comp);
01099 
01100   return eyedb::Success;
01101 }
01102 
01103 SysUserAccess::SysUserAccess(eyedb::Database *_db, const eyedb::Dataspace *_dataspace) : eyedb::Struct(_db, _dataspace)
01104 {
01105   initialize(_db);
01106 }
01107 
01108 SysUserAccess::SysUserAccess(const eyedb::Class *_cls, eyedb::Data _idr)
01109 {
01110   setClass((eyedb::Class *)_cls);
01111 
01112   eyedb::Size idr_psize;
01113   eyedb::Size idr_tsize = getClass()->getIDRObjectSize(&idr_psize);
01114   if (_idr)
01115     idr->setIDR(idr_tsize, _idr);
01116   else
01117     {
01118       idr->setIDR(idr_tsize);
01119       memset(idr->getIDR() + IDB_OBJ_HEAD_SIZE, 0, idr->getSize() - IDB_OBJ_HEAD_SIZE);
01120     }
01121   headerCode(eyedb::_Struct_Type, idr_psize, IDB_XINFO_LOCAL_OBJ);
01122   eyedb::ClassPeer::newObjRealize(getClass(), this);
01123   eyedb::ObjectPeer::setGRTObject(this, eyedb::True);
01124   userInitialize();
01125 }
01126 
01127 void SysUserAccess::initialize(eyedb::Database *_db)
01128 {
01129   setClass((_db ? _db->getSchema()->getClass("system_user_access") : SysUserAccess_Class));
01130 
01131   eyedb::Size idr_psize;
01132   idr->setIDR(getClass()->getIDRObjectSize(&idr_psize));
01133   memset(idr->getIDR() + IDB_OBJ_HEAD_SIZE, 0, idr->getSize() - IDB_OBJ_HEAD_SIZE);
01134   headerCode(eyedb::_Struct_Type, idr_psize, IDB_XINFO_LOCAL_OBJ);
01135   eyedb::ClassPeer::newObjRealize(getClass(), this);
01136   eyedb::ObjectPeer::setGRTObject(this, eyedb::True);
01137   userInitialize();
01138 }
01139 
01140 SysUserAccess::SysUserAccess(const SysUserAccess& x) : eyedb::Struct(x)
01141 {
01142   userCopy(x);
01143 }
01144 
01145 SysUserAccess& SysUserAccess::operator=(const SysUserAccess& x)
01146 {
01147   *(eyedb::Struct *)this = eyedb::Struct::operator=((const eyedb::Struct &)x);
01148   userCopy(x);
01149   return *this;
01150 }
01151 
01152 SysUserAccess::SysUserAccess(const eyedb::Struct *x, eyedb::Bool share) : eyedb::Struct(x, share)
01153 {
01154   setClass((db ? db->getSchema()->getClass("system_user_access") : SysUserAccess_Class));
01155 
01156   eyedb::Size idr_psize;
01157   getClass()->getIDRObjectSize(&idr_psize);
01158   if (!share)
01159     {
01160       headerCode(eyedb::_Struct_Type, idr_psize, IDB_XINFO_LOCAL_OBJ);
01161       eyedb::ClassPeer::newObjRealize(getClass(), this);
01162     }
01163 
01164   eyedb::ObjectPeer::setGRTObject(this, eyedb::True);
01165   userCopy(*x);
01166 }
01167 
01168 SysUserAccess::SysUserAccess(const SysUserAccess *x, eyedb::Bool share) : eyedb::Struct(x, share)
01169 {
01170   setClass((db ? db->getSchema()->getClass("system_user_access") : SysUserAccess_Class));
01171 
01172   eyedb::Size idr_psize;
01173   getClass()->getIDRObjectSize(&idr_psize);
01174   if (!share)
01175     {
01176       headerCode(eyedb::_Struct_Type, idr_psize, IDB_XINFO_LOCAL_OBJ);
01177       eyedb::ClassPeer::newObjRealize(getClass(), this);
01178     }
01179 
01180   eyedb::ObjectPeer::setGRTObject(this, eyedb::True);
01181   userCopy(*x);
01182 }
01183 
01184 eyedb::Status SysUserAccess::user(UserEntry*_user)
01185 {
01186   eyedb::gbxAutoGarbSuspender _gbxsusp_;
01187   eyedb::Status status;
01188 
01189   eyedb::Object *_ouser = _user;
01190 
01191   status = getClass()->getAttributes()[2]->setValue(this, (eyedb::Data)&_ouser, 1, 0);
01192   return status;
01193 }
01194 
01195 const UserEntry*SysUserAccess::user(eyedb::Bool *isnull, eyedb::Status *rs) const 
01196 {
01197   eyedb::gbxAutoGarbSuspender _gbxsusp_;
01198   eyedb::Object *__o = 0, *__go;
01199   eyedb::Status s;
01200 
01201   s = getClass()->getAttributes()[2]->getValue(this, (eyedb::Data *)&__o, 1, 0, isnull);
01202   if (s) {if (rs) *rs = s; return 0;}
01203 
01204   if (__o)
01205     {
01206      if (eyedb::ObjectPeer::isGRTObject(__o)) {
01207        return (UserEntry *)__o;
01208      }
01209      __go = (UserEntry *)make_object(__o, eyedb::False);
01210      if (__go)
01211       {
01212        __o = __go;
01213        s = getClass()->getAttributes()[2]->setValue((Agregat *)this, (eyedb::Data)&__o, 1, 0);
01214        eyedb::ObjectPeer::decrRefCount(__o);
01215        if (s) {if (rs) *rs = s; return 0;}
01216       }
01217      return (UserEntry*)__o;
01218     }
01219 
01220   eyedb::Bool wasnull = (!__o ? eyedb::True : eyedb::False);
01221   if (!__o && db)
01222     {
01223       eyedb::Oid toid;
01224       s = getClass()->getAttributes()[2]->getOid(this, &toid, 1, 0);
01225       if (s) {if (rs) *rs = s; return 0;}
01226       if (toid.isValid())
01227         {
01228           s = db->loadObject(&toid, &__o);
01229           if (s) {if (rs) *rs = s; return 0;}
01230           if (!eyedb::ObjectPeer::isGRTObject(__o))
01231            {
01232              __go = (UserEntry *)make_object(__o, eyedb::False);
01233              if (__go) __o = __go;
01234            }
01235         }
01236     }
01237 
01238   if (__o && wasnull)
01239     {
01240      s = getClass()->getAttributes()[2]->setValue((eyedb::Agregat *)this, (eyedb::Data)&__o, 1, 0);
01241      if (s) {if (rs) *rs = s; return 0;}
01242      __o->release();
01243     }
01244   return (UserEntry*)__o;
01245 }
01246 
01247 UserEntry*SysUserAccess::user(eyedb::Bool *isnull, eyedb::Status *rs) 
01248 {
01249   eyedb::gbxAutoGarbSuspender _gbxsusp_;
01250   eyedb::Object *__o = 0, *__go;
01251   eyedb::Status s;
01252 
01253   s = getClass()->getAttributes()[2]->getValue(this, (eyedb::Data *)&__o, 1, 0, isnull);
01254   if (s) {if (rs) *rs = s; return 0;}
01255 
01256   if (__o)
01257     {
01258      if (eyedb::ObjectPeer::isGRTObject(__o)) {
01259        return (UserEntry *)__o;
01260      }
01261      __go = (UserEntry *)make_object(__o, eyedb::False);
01262      if (__go)
01263       {
01264        __o = __go;
01265        s = getClass()->getAttributes()[2]->setValue((Agregat *)this, (eyedb::Data)&__o, 1, 0);
01266        eyedb::ObjectPeer::decrRefCount(__o);
01267        if (s) {if (rs) *rs = s; return 0;}
01268       }
01269      return (UserEntry*)__o;
01270     }
01271 
01272   eyedb::Bool wasnull = (!__o ? eyedb::True : eyedb::False);
01273   if (!__o && db)
01274     {
01275       eyedb::Oid toid;
01276       s = getClass()->getAttributes()[2]->getOid(this, &toid, 1, 0);
01277       if (s) {if (rs) *rs = s; return 0;}
01278       if (toid.isValid())
01279         {
01280           s = db->loadObject(&toid, &__o);
01281           if (s) {if (rs) *rs = s; return 0;}
01282           if (!eyedb::ObjectPeer::isGRTObject(__o))
01283            {
01284              __go = (UserEntry *)make_object(__o, eyedb::False);
01285              if (__go) __o = __go;
01286            }
01287         }
01288     }
01289 
01290   if (__o && wasnull)
01291     {
01292      s = getClass()->getAttributes()[2]->setValue((eyedb::Agregat *)this, (eyedb::Data)&__o, 1, 0);
01293      if (s) {if (rs) *rs = s; return 0;}
01294      __o->release();
01295     }
01296   return (UserEntry*)__o;
01297 }
01298 
01299 eyedb::Status SysUserAccess::user_oid(const eyedb::Oid &_oid)
01300 {
01301   eyedb::gbxAutoGarbSuspender _gbxsusp_;
01302   eyedb::Status status;
01303 
01304   status = getClass()->getAttributes()[2]->setOid(this, &_oid, 1, 0, oid_check);
01305   return status;
01306 }
01307 
01308 eyedb::Oid SysUserAccess::user_oid(eyedb::Status *rs) const
01309 {
01310   eyedb::gbxAutoGarbSuspender _gbxsusp_;
01311   eyedb::Oid __tmp;
01312   eyedb::Status s;
01313 
01314   s = getClass()->getAttributes()[2]->getOid(this, &__tmp, 1, 0);
01315   if (s) {if (rs) *rs = s; return nulloid;}
01316 
01317   return __tmp;
01318 }
01319 
01320 eyedb::Status SysUserAccess::mode(SysAccessMode _mode, eyedb::Bool _check_value)
01321 {
01322   eyedb::gbxAutoGarbSuspender _gbxsusp_;
01323   eyedb::Status status;
01324   eyedblib::int32 __tmp = _mode;
01325 
01326   status = getClass()->getAttributes()[3]->setValue(this, (eyedb::Data)&__tmp, 1, 0, _check_value);
01327   return status;
01328 }
01329 
01330 SysAccessMode SysUserAccess::mode(eyedb::Bool *isnull, eyedb::Status *rs) const
01331 {
01332   eyedb::gbxAutoGarbSuspender _gbxsusp_;
01333   eyedblib::int32  __tmp = 0;
01334   eyedb::Status s;
01335 
01336   s = getClass()->getAttributes()[3]->getValue(this, (eyedb::Data *)&__tmp, 1, 0, isnull);
01337   if (s) {if (rs) *rs = s; return (SysAccessMode)0;}
01338   return (SysAccessMode)__tmp;
01339 }
01340 
01341 static const eyedb::Attribute **DBEntry_agritems;
01342 static eyedb::Size DBEntry_idr_objsz, DBEntry_idr_psize;
01343 
01344 static eyedb::StructClass *DBEntry_make(eyedb::StructClass *DBEntry_class = 0, eyedb::Schema *m = 0)
01345 {
01346   if (!DBEntry_class)
01347     return new eyedb::StructClass("database_entry", (m ? m->getClass("struct") : eyedb::Struct_Class));
01348   eyedb::Attribute *attr[9];
01349   int *dims;
01350 
01351   dims = new int[1];
01352   dims[0] = -1;
01353   attr[2] = new eyedb::Attribute((m ? m->getClass("char") : eyedb::Char_Class), "dbname", eyedb::False, 1, dims);
01354   delete[] dims;
01355 
01356   dims = 0;
01357   attr[3] = new eyedb::Attribute((m ? m->getClass("int") : eyedb::Int32_Class), "dbid", eyedb::False, 0, dims);
01358 
01359   dims = new int[1];
01360   dims[0] = -1;
01361   attr[4] = new eyedb::Attribute((m ? m->getClass("char") : eyedb::Char_Class), "dbfile", eyedb::False, 1, dims);
01362   delete[] dims;
01363 
01364   dims = 0;
01365   attr[5] = new eyedb::Attribute((m ? m->getClass("database_access_mode") : DBAccessMode_Class), "default_access", eyedb::False, 0, dims);
01366 
01367   dims = 0;
01368   attr[6] = new eyedb::Attribute((m ? m->getClass("object") : eyedb::Object_Class), "schm", eyedb::True, 0, dims);
01369 
01370   dims = new int[1];
01371   dims[0] = -1;
01372   attr[7] = new eyedb::Attribute((m ? m->getClass("char") : eyedb::Char_Class), "comment", eyedb::False, 1, dims);
01373   delete[] dims;
01374 
01375   dims = new int[1];
01376   dims[0] = -1;
01377   attr[8] = new eyedb::Attribute((m ? m->getClass("database_property") : DBProperty_Class), "props", eyedb::True, 1, dims);
01378   delete[] dims;
01379 
01380   DBEntry_class->setAttributes(&attr[2], 7);
01381 
01382   delete attr[2];
01383   delete attr[3];
01384   delete attr[4];
01385   delete attr[5];
01386   delete attr[6];
01387   delete attr[7];
01388   delete attr[8];
01389 
01390 
01391   return DBEntry_class;
01392 }
01393 
01394 eyedb::Object *DBEntry_construct_x(const eyedb::Class *cls, eyedb::Data idr)
01395 {
01396   return new DBEntry(cls, idr);
01397 }
01398 
01399 eyedb::Object *DBEntry_construct(const eyedb::Object *o, eyedb::Bool share)
01400 {
01401   return new DBEntry((const eyedb::Struct *)o, share);
01402 }
01403 
01404 static void DBEntry_init_p()
01405 {
01406   DBEntry_Class = DBEntry_make();
01407   constructors_x[class_ind] = DBEntry_construct_x;
01408   constructors[class_ind] = DBEntry_construct;
01409   hash->insert("database_entry", class_ind++);
01410 }
01411 
01412 static void DBEntry_init()
01413 {
01414   DBEntry_make(DBEntry_Class);
01415 
01416   DBEntry_agritems = DBEntry_Class->getAttributes();
01417   DBEntry_idr_objsz = DBEntry_Class->getIDRObjectSize(&DBEntry_idr_psize, 0);
01418 
01419   eyedb::ObjectPeer::setUnrealizable(DBEntry_Class, eyedb::True);
01420 }
01421 
01422 static eyedb::Status DBEntry_attrcomp_realize(eyedb::Database *db, eyedb::Class *cls)
01423 {
01424   eyedb::AttributeComponent *comp;
01425   const eyedb::Dataspace *dataspace;
01426   eyedb::ClassComponent *clcomp;
01427   eyedb::Status status;
01428   int *impl_hints;
01429   comp = new eyedb::UniqueConstraint(db, cls, "database_entry.dbname", eyedb::True);
01430   cls->add(comp->getInd(), comp);
01431 
01432   impl_hints = new int[8];
01433   impl_hints[0] = 0;
01434   impl_hints[1] = 0;
01435   impl_hints[2] = 0;
01436   impl_hints[3] = 0;
01437   impl_hints[4] = 0;
01438   impl_hints[5] = 0;
01439   impl_hints[6] = 0;
01440   impl_hints[7] = 0;
01441   dataspace = 0;;
01442   comp = new eyedb::HashIndex(db, cls, "database_entry.dbname", eyedb::True, eyedb::True, dataspace, 0, 0, impl_hints, 8);
01443   delete [] impl_hints;
01444   cls->add(comp->getInd(), comp);
01445 
01446   impl_hints = new int[8];
01447   impl_hints[0] = 0;
01448   impl_hints[1] = 0;
01449   impl_hints[2] = 0;
01450   impl_hints[3] = 0;
01451   impl_hints[4] = 0;
01452   impl_hints[5] = 0;
01453   impl_hints[6] = 0;
01454   impl_hints[7] = 0;
01455   dataspace = 0;;
01456   comp = new eyedb::BTreeIndex(db, cls, "database_entry.dbid", eyedb::True, eyedb::False, dataspace, 0, impl_hints, 8);
01457   delete [] impl_hints;
01458   cls->add(comp->getInd(), comp);
01459 
01460   return eyedb::Success;
01461 }
01462 
01463 DBEntry::DBEntry(eyedb::Database *_db, const eyedb::Dataspace *_dataspace) : eyedb::Struct(_db, _dataspace)
01464 {
01465   initialize(_db);
01466 }
01467 
01468 DBEntry::DBEntry(const eyedb::Class *_cls, eyedb::Data _idr)
01469 {
01470   setClass((eyedb::Class *)_cls);
01471 
01472   eyedb::Size idr_psize;
01473   eyedb::Size idr_tsize = getClass()->getIDRObjectSize(&idr_psize);
01474   if (_idr)
01475     idr->setIDR(idr_tsize, _idr);
01476   else
01477     {
01478       idr->setIDR(idr_tsize);
01479       memset(idr->getIDR() + IDB_OBJ_HEAD_SIZE, 0, idr->getSize() - IDB_OBJ_HEAD_SIZE);
01480     }
01481   headerCode(eyedb::_Struct_Type, idr_psize, IDB_XINFO_LOCAL_OBJ);
01482   eyedb::ClassPeer::newObjRealize(getClass(), this);
01483   eyedb::ObjectPeer::setGRTObject(this, eyedb::True);
01484   userInitialize();
01485 }
01486 
01487 void DBEntry::initialize(eyedb::Database *_db)
01488 {
01489   setClass((_db ? _db->getSchema()->getClass("database_entry") : DBEntry_Class));
01490 
01491   eyedb::Size idr_psize;
01492   idr->setIDR(getClass()->getIDRObjectSize(&idr_psize));
01493   memset(idr->getIDR() + IDB_OBJ_HEAD_SIZE, 0, idr->getSize() - IDB_OBJ_HEAD_SIZE);
01494   headerCode(eyedb::_Struct_Type, idr_psize, IDB_XINFO_LOCAL_OBJ);
01495   eyedb::ClassPeer::newObjRealize(getClass(), this);
01496   eyedb::ObjectPeer::setGRTObject(this, eyedb::True);
01497   userInitialize();
01498 }
01499 
01500 DBEntry::DBEntry(const DBEntry& x) : eyedb::Struct(x)
01501 {
01502   userCopy(x);
01503 }
01504 
01505 DBEntry& DBEntry::operator=(const DBEntry& x)
01506 {
01507   *(eyedb::Struct *)this = eyedb::Struct::operator=((const eyedb::Struct &)x);
01508   userCopy(x);
01509   return *this;
01510 }
01511 
01512 DBEntry::DBEntry(const eyedb::Struct *x, eyedb::Bool share) : eyedb::Struct(x, share)
01513 {
01514   setClass((db ? db->getSchema()->getClass("database_entry") : DBEntry_Class));
01515 
01516   eyedb::Size idr_psize;
01517   getClass()->getIDRObjectSize(&idr_psize);
01518   if (!share)
01519     {
01520       headerCode(eyedb::_Struct_Type, idr_psize, IDB_XINFO_LOCAL_OBJ);
01521       eyedb::ClassPeer::newObjRealize(getClass(), this);
01522     }
01523 
01524   eyedb::ObjectPeer::setGRTObject(this, eyedb::True);
01525   userCopy(*x);
01526 }
01527 
01528 DBEntry::DBEntry(const DBEntry *x, eyedb::Bool share) : eyedb::Struct(x, share)
01529 {
01530   setClass((db ? db->getSchema()->getClass("database_entry") : DBEntry_Class));
01531 
01532   eyedb::Size idr_psize;
01533   getClass()->getIDRObjectSize(&idr_psize);
01534   if (!share)
01535     {
01536       headerCode(eyedb::_Struct_Type, idr_psize, IDB_XINFO_LOCAL_OBJ);
01537       eyedb::ClassPeer::newObjRealize(getClass(), this);
01538     }
01539 
01540   eyedb::ObjectPeer::setGRTObject(this, eyedb::True);
01541   userCopy(*x);
01542 }
01543 
01544 eyedb::Status DBEntry::dbname(const std::string &_dbname)
01545 {
01546   eyedb::gbxAutoGarbSuspender _gbxsusp_;
01547   eyedb::Status status;
01548   eyedb::Size size;
01549   eyedb::Size len = _dbname.size() + 1;
01550 
01551   status = getClass()->getAttributes()[2]->getSize(this, size);
01552   if (status)
01553     return status;
01554 
01555   if (size != len)
01556     status = getClass()->getAttributes()[2]->setSize(this, len);
01557   if (status)
01558     return status;
01559 
01560   status = getClass()->getAttributes()[2]->setValue(this, (eyedb::Data)_dbname.c_str(), len, 0);
01561   return status;
01562 
01563 }
01564 
01565 eyedb::Status DBEntry::dbname(unsigned int a0, char _dbname)
01566 {
01567   eyedb::gbxAutoGarbSuspender _gbxsusp_;
01568   eyedb::Status status;
01569   eyedb::Size from = a0;
01570 
01571   eyedb::Size size;
01572   status = getClass()->getAttributes()[2]->getSize(this, size);
01573   if (status)
01574     return status;
01575 
01576   if (size <= from)
01577     status = getClass()->getAttributes()[2]->setSize(this, from+1);
01578   if (status)
01579     return status;
01580 
01581   status = getClass()->getAttributes()[2]->setValue(this, (eyedb::Data)&_dbname, 1, from);
01582   return status;
01583 }
01584 
01585 std::string DBEntry::dbname(eyedb::Bool *isnull, eyedb::Status *rs) const
01586 {
01587   eyedb::gbxAutoGarbSuspender _gbxsusp_;
01588   eyedb::Data data;
01589   eyedb::Status s;
01590 
01591   s = getClass()->getAttributes()[2]->getValue(this, (eyedb::Data *)&data, eyedb::Attribute::directAccess, 0, isnull);
01592   if (s) {if (rs) *rs = s; return 0;}
01593   if (!data) data = nulldata;
01594   return (const char *)data;
01595 }
01596 
01597 char DBEntry::dbname(unsigned int a0, eyedb::Bool *isnull, eyedb::Status *rs) const
01598 {
01599   eyedb::gbxAutoGarbSuspender _gbxsusp_;
01600   char __tmp = 0;
01601   eyedb::Status s;
01602   eyedb::Size from = a0;
01603 
01604   s = getClass()->getAttributes()[2]->getValue(this, (eyedb::Data *)&__tmp, 1, from, isnull);
01605   if (s) {if (rs) *rs = s; return 0;}
01606   return __tmp;
01607 }
01608 
01609 eyedb::Status DBEntry::dbid(eyedblib::int32 _dbid)
01610 {
01611   eyedb::gbxAutoGarbSuspender _gbxsusp_;
01612   eyedb::Status status;
01613 
01614   status = getClass()->getAttributes()[3]->setValue(this, (eyedb::Data)&_dbid, 1, 0);
01615   return status;
01616 }
01617 
01618 eyedblib::int32 DBEntry::dbid(eyedb::Bool *isnull, eyedb::Status *rs) const
01619 {
01620   eyedb::gbxAutoGarbSuspender _gbxsusp_;
01621   eyedblib::int32 __tmp = 0;
01622   eyedb::Status s;
01623 
01624   s = getClass()->getAttributes()[3]->getValue(this, (eyedb::Data *)&__tmp, 1, 0, isnull);
01625   if (s) {if (rs) *rs = s; return 0;}
01626   return __tmp;
01627 }
01628 
01629 eyedb::Status DBEntry::dbfile(const std::string &_dbfile)
01630 {
01631   eyedb::gbxAutoGarbSuspender _gbxsusp_;
01632   eyedb::Status status;
01633   eyedb::Size size;
01634   eyedb::Size len = _dbfile.size() + 1;
01635 
01636   status = getClass()->getAttributes()[4]->getSize(this, size);
01637   if (status)
01638     return status;
01639 
01640   if (size != len)
01641     status = getClass()->getAttributes()[4]->setSize(this, len);
01642   if (status)
01643     return status;
01644 
01645   status = getClass()->getAttributes()[4]->setValue(this, (eyedb::Data)_dbfile.c_str(), len, 0);
01646   return status;
01647 
01648 }
01649 
01650 eyedb::Status DBEntry::dbfile(unsigned int a0, char _dbfile)
01651 {
01652   eyedb::gbxAutoGarbSuspender _gbxsusp_;
01653   eyedb::Status status;
01654   eyedb::Size from = a0;
01655 
01656   eyedb::Size size;
01657   status = getClass()->getAttributes()[4]->getSize(this, size);
01658   if (status)
01659     return status;
01660 
01661   if (size <= from)
01662     status = getClass()->getAttributes()[4]->setSize(this, from+1);
01663   if (status)
01664     return status;
01665 
01666   status = getClass()->getAttributes()[4]->setValue(this, (eyedb::Data)&_dbfile, 1, from);
01667   return status;
01668 }
01669 
01670 std::string DBEntry::dbfile(eyedb::Bool *isnull, eyedb::Status *rs) const
01671 {
01672   eyedb::gbxAutoGarbSuspender _gbxsusp_;
01673   eyedb::Data data;
01674   eyedb::Status s;
01675 
01676   s = getClass()->getAttributes()[4]->getValue(this, (eyedb::Data *)&data, eyedb::Attribute::directAccess, 0, isnull);
01677   if (s) {if (rs) *rs = s; return 0;}
01678   if (!data) data = nulldata;
01679   return (const char *)data;
01680 }
01681 
01682 char DBEntry::dbfile(unsigned int a0, eyedb::Bool *isnull, eyedb::Status *rs) const
01683 {
01684   eyedb::gbxAutoGarbSuspender _gbxsusp_;
01685   char __tmp = 0;
01686   eyedb::Status s;
01687   eyedb::Size from = a0;
01688 
01689   s = getClass()->getAttributes()[4]->getValue(this, (eyedb::Data *)&__tmp, 1, from, isnull);
01690   if (s) {if (rs) *rs = s; return 0;}
01691   return __tmp;
01692 }
01693 
01694 eyedb::Status DBEntry::default_access(DBAccessMode _default_access, eyedb::Bool _check_value)
01695 {
01696   eyedb::gbxAutoGarbSuspender _gbxsusp_;
01697   eyedb::Status status;
01698   eyedblib::int32 __tmp = _default_access;
01699 
01700   status = getClass()->getAttributes()[5]->setValue(this, (eyedb::Data)&__tmp, 1, 0, _check_value);
01701   return status;
01702 }
01703 
01704 DBAccessMode DBEntry::default_access(eyedb::Bool *isnull, eyedb::Status *rs) const
01705 {
01706   eyedb::gbxAutoGarbSuspender _gbxsusp_;
01707   eyedblib::int32  __tmp = 0;
01708   eyedb::Status s;
01709 
01710   s = getClass()->getAttributes()[5]->getValue(this, (eyedb::Data *)&__tmp, 1, 0, isnull);
01711   if (s) {if (rs) *rs = s; return (DBAccessMode)0;}
01712   return (DBAccessMode)__tmp;
01713 }
01714 
01715 eyedb::Status DBEntry::schm(eyedb::Object*_schm)
01716 {
01717   eyedb::gbxAutoGarbSuspender _gbxsusp_;
01718   eyedb::Status status;
01719 
01720   eyedb::Object *_oschm = _schm;
01721 
01722   status = getClass()->getAttributes()[6]->setValue(this, (eyedb::Data)&_oschm, 1, 0);
01723   return status;
01724 }
01725 
01726 const eyedb::Object*DBEntry::schm(eyedb::Bool *isnull, eyedb::Status *rs) const 
01727 {
01728   eyedb::gbxAutoGarbSuspender _gbxsusp_;
01729   eyedb::Object *__o = 0, *__go;
01730   eyedb::Status s;
01731 
01732   s = getClass()->getAttributes()[6]->getValue(this, (eyedb::Data *)&__o, 1, 0, isnull);
01733   if (s) {if (rs) *rs = s; return 0;}
01734 
01735   if (__o)
01736     {
01737      if (eyedb::ObjectPeer::isGRTObject(__o)) {
01738        return (eyedb::Object *)__o;
01739      }
01740      __go = (eyedb::Object *)make_object(__o, eyedb::False);
01741      if (__go)
01742       {
01743        __o = __go;
01744        s = getClass()->getAttributes()[6]->setValue((Agregat *)this, (eyedb::Data)&__o, 1, 0);
01745        eyedb::ObjectPeer::decrRefCount(__o);
01746        if (s) {if (rs) *rs = s; return 0;}
01747       }
01748      return (eyedb::Object*)__o;
01749     }
01750 
01751   eyedb::Bool wasnull = (!__o ? eyedb::True : eyedb::False);
01752   if (!__o && db)
01753     {
01754       eyedb::Oid toid;
01755       s = getClass()->getAttributes()[6]->getOid(this, &toid, 1, 0);
01756       if (s) {if (rs) *rs = s; return 0;}
01757       if (toid.isValid())
01758         {
01759           s = db->loadObject(&toid, &__o);
01760           if (s) {if (rs) *rs = s; return 0;}
01761           if (!eyedb::ObjectPeer::isGRTObject(__o))
01762            {
01763              __go = (eyedb::Object *)make_object(__o, eyedb::False);
01764              if (__go) __o = __go;
01765            }
01766         }
01767     }
01768 
01769   if (__o && wasnull)
01770     {
01771      s = getClass()->getAttributes()[6]->setValue((eyedb::Agregat *)this, (eyedb::Data)&__o, 1, 0);
01772      if (s) {if (rs) *rs = s; return 0;}
01773      __o->release();
01774     }
01775   return (eyedb::Object*)__o;
01776 }
01777 
01778 eyedb::Object*DBEntry::schm(eyedb::Bool *isnull, eyedb::Status *rs) 
01779 {
01780   eyedb::gbxAutoGarbSuspender _gbxsusp_;
01781   eyedb::Object *__o = 0, *__go;
01782   eyedb::Status s;
01783 
01784   s = getClass()->getAttributes()[6]->getValue(this, (eyedb::Data *)&__o, 1, 0, isnull);
01785   if (s) {if (rs) *rs = s; return 0;}
01786 
01787   if (__o)
01788     {
01789      if (eyedb::ObjectPeer::isGRTObject(__o)) {
01790        return (eyedb::Object *)__o;
01791      }
01792      __go = (eyedb::Object *)make_object(__o, eyedb::False);
01793      if (__go)
01794       {
01795        __o = __go;
01796        s = getClass()->getAttributes()[6]->setValue((Agregat *)this, (eyedb::Data)&__o, 1, 0);
01797        eyedb::ObjectPeer::decrRefCount(__o);
01798        if (s) {if (rs) *rs = s; return 0;}
01799       }
01800      return (eyedb::Object*)__o;
01801     }
01802 
01803   eyedb::Bool wasnull = (!__o ? eyedb::True : eyedb::False);
01804   if (!__o && db)
01805     {
01806       eyedb::Oid toid;
01807       s = getClass()->getAttributes()[6]->getOid(this, &toid, 1, 0);
01808       if (s) {if (rs) *rs = s; return 0;}
01809       if (toid.isValid())
01810         {
01811           s = db->loadObject(&toid, &__o);
01812           if (s) {if (rs) *rs = s; return 0;}
01813           if (!eyedb::ObjectPeer::isGRTObject(__o))
01814            {
01815              __go = (eyedb::Object *)make_object(__o, eyedb::False);
01816              if (__go) __o = __go;
01817            }
01818         }
01819     }
01820 
01821   if (__o && wasnull)
01822     {
01823      s = getClass()->getAttributes()[6]->setValue((eyedb::Agregat *)this, (eyedb::Data)&__o, 1, 0);
01824      if (s) {if (rs) *rs = s; return 0;}
01825      __o->release();
01826     }
01827   return (eyedb::Object*)__o;
01828 }
01829 
01830 eyedb::Status DBEntry::schm_oid(const eyedb::Oid &_oid)
01831 {
01832   eyedb::gbxAutoGarbSuspender _gbxsusp_;
01833   eyedb::Status status;
01834 
01835   status = getClass()->getAttributes()[6]->setOid(this, &_oid, 1, 0, oid_check);
01836   return status;
01837 }
01838 
01839 eyedb::Oid DBEntry::schm_oid(eyedb::Status *rs) const
01840 {
01841   eyedb::gbxAutoGarbSuspender _gbxsusp_;
01842   eyedb::Oid __tmp;
01843   eyedb::Status s;
01844 
01845   s = getClass()->getAttributes()[6]->getOid(this, &__tmp, 1, 0);
01846   if (s) {if (rs) *rs = s; return nulloid;}
01847 
01848   return __tmp;
01849 }
01850 
01851 eyedb::Status DBEntry::comment(const std::string &_comment)
01852 {
01853   eyedb::gbxAutoGarbSuspender _gbxsusp_;
01854   eyedb::Status status;
01855   eyedb::Size size;
01856   eyedb::Size len = _comment.size() + 1;
01857 
01858   status = getClass()->getAttributes()[7]->getSize(this, size);
01859   if (status)
01860     return status;
01861 
01862   if (size != len)
01863     status = getClass()->getAttributes()[7]->setSize(this, len);
01864   if (status)
01865     return status;
01866 
01867   status = getClass()->getAttributes()[7]->setValue(this, (eyedb::Data)_comment.c_str(), len, 0);
01868   return status;
01869 
01870 }
01871 
01872 eyedb::Status DBEntry::comment(unsigned int a0, char _comment)
01873 {
01874   eyedb::gbxAutoGarbSuspender _gbxsusp_;
01875   eyedb::Status status;
01876   eyedb::Size from = a0;
01877 
01878   eyedb::Size size;
01879   status = getClass()->getAttributes()[7]->getSize(this, size);
01880   if (status)
01881     return status;
01882 
01883   if (size <= from)
01884     status = getClass()->getAttributes()[7]->setSize(this, from+1);
01885   if (status)
01886     return status;
01887 
01888   status = getClass()->getAttributes()[7]->setValue(this, (eyedb::Data)&_comment, 1, from);
01889   return status;
01890 }
01891 
01892 std::string DBEntry::comment(eyedb::Bool *isnull, eyedb::Status *rs) const
01893 {
01894   eyedb::gbxAutoGarbSuspender _gbxsusp_;
01895   eyedb::Data data;
01896   eyedb::Status s;
01897 
01898   s = getClass()->getAttributes()[7]->getValue(this, (eyedb::Data *)&data, eyedb::Attribute::directAccess, 0, isnull);
01899   if (s) {if (rs) *rs = s; return 0;}
01900   if (!data) data = nulldata;
01901   return (const char *)data;
01902 }
01903 
01904 char DBEntry::comment(unsigned int a0, eyedb::Bool *isnull, eyedb::Status *rs) const
01905 {
01906   eyedb::gbxAutoGarbSuspender _gbxsusp_;
01907   char __tmp = 0;
01908   eyedb::Status s;
01909   eyedb::Size from = a0;
01910 
01911   s = getClass()->getAttributes()[7]->getValue(this, (eyedb::Data *)&__tmp, 1, from, isnull);
01912   if (s) {if (rs) *rs = s; return 0;}
01913   return __tmp;
01914 }
01915 
01916 eyedb::Status DBEntry::props(unsigned int a0, DBProperty*_props)
01917 {
01918   eyedb::gbxAutoGarbSuspender _gbxsusp_;
01919   eyedb::Status status;
01920   eyedb::Size from = a0;
01921 
01922   eyedb::Size size;
01923   status = getClass()->getAttributes()[8]->getSize(this, size);
01924   if (status)
01925     return status;
01926 
01927   if (size <= from)
01928     status = getClass()->getAttributes()[8]->setSize(this, from+1);
01929   if (status)
01930     return status;
01931 
01932   eyedb::Object *_oprops = _props;
01933 
01934   status = getClass()->getAttributes()[8]->setValue(this, (eyedb::Data)&_oprops, 1, from);
01935   return status;
01936 }
01937 
01938 eyedb::Status DBEntry::props_cnt(unsigned int a0)
01939 {
01940   eyedb::gbxAutoGarbSuspender _gbxsusp_;
01941   eyedb::Status status;
01942   eyedb::Size from = a0;
01943   status = getClass()->getAttributes()[8]->setSize(this, from);
01944   return status;
01945 }
01946 
01947 const DBProperty*DBEntry::props(unsigned int a0, eyedb::Bool *isnull, eyedb::Status *rs) const 
01948 {
01949   eyedb::gbxAutoGarbSuspender _gbxsusp_;
01950   eyedb::Object *__o = 0, *__go;
01951   eyedb::Status s;
01952   eyedb::Size from = a0;
01953 
01954   s = getClass()->getAttributes()[8]->getValue(this, (eyedb::Data *)&__o, 1, from, isnull);
01955   if (s) {if (rs) *rs = s; return 0;}
01956 
01957   if (__o)
01958     {
01959      if (eyedb::ObjectPeer::isGRTObject(__o)) {
01960        return (DBProperty *)__o;
01961      }
01962      __go = (DBProperty *)make_object(__o, eyedb::False);
01963      if (__go)
01964       {
01965        __o = __go;
01966        s = getClass()->getAttributes()[8]->setValue((Agregat *)this, (eyedb::Data)&__o, 1, from);
01967        eyedb::ObjectPeer::decrRefCount(__o);
01968        if (s) {if (rs) *rs = s; return 0;}
01969       }
01970      return (DBProperty*)__o;
01971     }
01972 
01973   eyedb::Bool wasnull = (!__o ? eyedb::True : eyedb::False);
01974   if (!__o && db)
01975     {
01976       eyedb::Oid toid;
01977       s = getClass()->getAttributes()[8]->getOid(this, &toid, 1, from);
01978       if (s) {if (rs) *rs = s; return 0;}
01979       if (toid.isValid())
01980         {
01981           s = db->loadObject(&toid, &__o);
01982           if (s) {if (rs) *rs = s; return 0;}
01983           if (!eyedb::ObjectPeer::isGRTObject(__o))
01984            {
01985              __go = (DBProperty *)make_object(__o, eyedb::False);
01986              if (__go) __o = __go;
01987            }
01988         }
01989     }
01990 
01991   if (__o && wasnull)
01992     {
01993      s = getClass()->getAttributes()[8]->setValue((eyedb::Agregat *)this, (eyedb::Data)&__o, 1, from);
01994      if (s) {if (rs) *rs = s; return 0;}
01995      __o->release();
01996     }
01997   return (DBProperty*)__o;
01998 }
01999 
02000 DBProperty*DBEntry::props(unsigned int a0, eyedb::Bool *isnull, eyedb::Status *rs) 
02001 {
02002   eyedb::gbxAutoGarbSuspender _gbxsusp_;
02003   eyedb::Object *__o = 0, *__go;
02004   eyedb::Status s;
02005   eyedb::Size from = a0;
02006 
02007   s = getClass()->getAttributes()[8]->getValue(this, (eyedb::Data *)&__o, 1, from, isnull);
02008   if (s) {if (rs) *rs = s; return 0;}
02009 
02010   if (__o)
02011     {
02012      if (eyedb::ObjectPeer::isGRTObject(__o)) {
02013        return (DBProperty *)__o;
02014      }
02015      __go = (DBProperty *)make_object(__o, eyedb::False);
02016      if (__go)
02017       {
02018        __o = __go;
02019        s = getClass()->getAttributes()[8]->setValue((Agregat *)this, (eyedb::Data)&__o, 1, from);
02020        eyedb::ObjectPeer::decrRefCount(__o);
02021        if (s) {if (rs) *rs = s; return 0;}
02022       }
02023      return (DBProperty*)__o;
02024     }
02025 
02026   eyedb::Bool wasnull = (!__o ? eyedb::True : eyedb::False);
02027   if (!__o && db)
02028     {
02029       eyedb::Oid toid;
02030       s = getClass()->getAttributes()[8]->getOid(this, &toid, 1, from);
02031       if (s) {if (rs) *rs = s; return 0;}
02032       if (toid.isValid())
02033         {
02034           s = db->loadObject(&toid, &__o);
02035           if (s) {if (rs) *rs = s; return 0;}
02036           if (!eyedb::ObjectPeer::isGRTObject(__o))
02037            {
02038              __go = (DBProperty *)make_object(__o, eyedb::False);
02039              if (__go) __o = __go;
02040            }
02041         }
02042     }
02043 
02044   if (__o && wasnull)
02045     {
02046      s = getClass()->getAttributes()[8]->setValue((eyedb::Agregat *)this, (eyedb::Data)&__o, 1, from);
02047      if (s) {if (rs) *rs = s; return 0;}
02048      __o->release();
02049     }
02050   return (DBProperty*)__o;
02051 }
02052 
02053 unsigned int DBEntry::props_cnt(eyedb::Status *rs) const
02054 {
02055   eyedb::gbxAutoGarbSuspender _gbxsusp_;
02056   eyedb::Size size;
02057   eyedb::Status s;
02058   s = getClass()->getAttributes()[8]->getSize(this, size);
02059   if (s) {if (rs) *rs = s; return 0;}
02060   return (int)size;
02061 }
02062 
02063 eyedb::Status DBEntry::props_oid(unsigned int a0, const eyedb::Oid &_oid)
02064 {
02065   eyedb::gbxAutoGarbSuspender _gbxsusp_;
02066   eyedb::Status status;
02067   eyedb::Size from = a0;
02068 
02069   eyedb::Size size;
02070   status = getClass()->getAttributes()[8]->getSize(this, size);
02071   if (status)
02072     return status;
02073 
02074   if (size <= from)
02075     status = getClass()->getAttributes()[8]->setSize(this, from+1);
02076   if (status)
02077     return status;
02078 
02079   status = getClass()->getAttributes()[8]->setOid(this, &_oid, 1, from, oid_check);
02080   return status;
02081 }
02082 
02083 eyedb::Oid DBEntry::props_oid(unsigned int a0, eyedb::Status *rs) const
02084 {
02085   eyedb::gbxAutoGarbSuspender _gbxsusp_;
02086   eyedb::Oid __tmp;
02087   eyedb::Status s;
02088   eyedb::Size from = a0;
02089 
02090   s = getClass()->getAttributes()[8]->getOid(this, &__tmp, 1, from);
02091   if (s) {if (rs) *rs = s; return nulloid;}
02092 
02093   return __tmp;
02094 }
02095 
02096 static const eyedb::Attribute **DBPropertyValue_agritems;
02097 static eyedb::Size DBPropertyValue_idr_objsz, DBPropertyValue_idr_psize;
02098 
02099 static eyedb::StructClass *DBPropertyValue_make(eyedb::StructClass *DBPropertyValue_class = 0, eyedb::Schema *m = 0)
02100 {
02101   if (!DBPropertyValue_class)
02102     return new eyedb::StructClass("database_property_value", (m ? m->getClass("struct") : eyedb::Struct_Class));
02103   eyedb::Attribute *attr[6];
02104   int *dims;
02105 
02106   dims = 0;
02107   attr[2] = new eyedb::Attribute((m ? m->getClass("long") : eyedb::Int64_Class), "ival", eyedb::False, 0, dims);
02108 
02109   dims = new int[1];
02110   dims[0] = -1;
02111   attr[3] = new eyedb::Attribute((m ? m->getClass("char") : eyedb::Char_Class), "sval", eyedb::False, 1, dims);
02112   delete[] dims;
02113 
02114   dims = new int[1];
02115   dims[0] = -1;
02116   attr[4] = new eyedb::Attribute((m ? m->getClass("byte") : eyedb::Byte_Class), "bval", eyedb::False, 1, dims);
02117   delete[] dims;
02118 
02119   dims = 0;
02120   attr[5] = new eyedb::Attribute((m ? m->getClass("object") : eyedb::Object_Class), "oval", eyedb::True, 0, dims);
02121 
02122   DBPropertyValue_class->setAttributes(&attr[2], 4);
02123 
02124   delete attr[2];
02125   delete attr[3];
02126   delete attr[4];
02127   delete attr[5];
02128 
02129 
02130   return DBPropertyValue_class;
02131 }
02132 
02133 eyedb::Object *DBPropertyValue_construct_x(const eyedb::Class *cls, eyedb::Data idr)
02134 {
02135   return new DBPropertyValue(cls, idr);
02136 }
02137 
02138 eyedb::Object *DBPropertyValue_construct(const eyedb::Object *o, eyedb::Bool share)
02139 {
02140   return new DBPropertyValue((const eyedb::Struct *)o, share);
02141 }
02142 
02143 static void DBPropertyValue_init_p()
02144 {
02145   DBPropertyValue_Class = DBPropertyValue_make();
02146   constructors_x[class_ind] = DBPropertyValue_construct_x;
02147   constructors[class_ind] = DBPropertyValue_construct;
02148   hash->insert("database_property_value", class_ind++);
02149 }
02150 
02151 static void DBPropertyValue_init()
02152 {
02153   DBPropertyValue_make(DBPropertyValue_Class);
02154 
02155   DBPropertyValue_agritems = DBPropertyValue_Class->getAttributes();
02156   DBPropertyValue_idr_objsz = DBPropertyValue_Class->getIDRObjectSize(&DBPropertyValue_idr_psize, 0);
02157 
02158   eyedb::ObjectPeer::setUnrealizable(DBPropertyValue_Class, eyedb::True);
02159 }
02160 
02161 static eyedb::Status DBPropertyValue_attrcomp_realize(eyedb::Database *db, eyedb::Class *cls)
02162 {
02163   return eyedb::Success;
02164 }
02165 
02166 DBPropertyValue::DBPropertyValue(eyedb::Database *_db, const eyedb::Dataspace *_dataspace) : eyedb::Struct(_db, _dataspace)
02167 {
02168   initialize(_db);
02169 }
02170 
02171 DBPropertyValue::DBPropertyValue(const eyedb::Class *_cls, eyedb::Data _idr)
02172 {
02173   setClass((eyedb::Class *)_cls);
02174 
02175   eyedb::Size idr_psize;
02176   eyedb::Size idr_tsize = getClass()->getIDRObjectSize(&idr_psize);
02177   if (_idr)
02178     idr->setIDR(idr_tsize, _idr);
02179   else
02180     {
02181       idr->setIDR(idr_tsize);
02182       memset(idr->getIDR() + IDB_OBJ_HEAD_SIZE, 0, idr->getSize() - IDB_OBJ_HEAD_SIZE);
02183     }
02184   headerCode(eyedb::_Struct_Type, idr_psize, IDB_XINFO_LOCAL_OBJ);
02185   eyedb::ClassPeer::newObjRealize(getClass(), this);
02186   eyedb::ObjectPeer::setGRTObject(this, eyedb::True);
02187   userInitialize();
02188 }
02189 
02190 void DBPropertyValue::initialize(eyedb::Database *_db)
02191 {
02192   setClass((_db ? _db->getSchema()->getClass("database_property_value") : DBPropertyValue_Class));
02193 
02194   eyedb::Size idr_psize;
02195   idr->setIDR(getClass()->getIDRObjectSize(&idr_psize));
02196   memset(idr->getIDR() + IDB_OBJ_HEAD_SIZE, 0, idr->getSize() - IDB_OBJ_HEAD_SIZE);
02197   headerCode(eyedb::_Struct_Type, idr_psize, IDB_XINFO_LOCAL_OBJ);
02198   eyedb::ClassPeer::newObjRealize(getClass(), this);
02199   eyedb::ObjectPeer::setGRTObject(this, eyedb::True);
02200   userInitialize();
02201 }
02202 
02203 DBPropertyValue::DBPropertyValue(const DBPropertyValue& x) : eyedb::Struct(x)
02204 {
02205   userCopy(x);
02206 }
02207 
02208 DBPropertyValue& DBPropertyValue::operator=(const DBPropertyValue& x)
02209 {
02210   *(eyedb::Struct *)this = eyedb::Struct::operator=((const eyedb::Struct &)x);
02211   userCopy(x);
02212   return *this;
02213 }
02214 
02215 DBPropertyValue::DBPropertyValue(const eyedb::Struct *x, eyedb::Bool share) : eyedb::Struct(x, share)
02216 {
02217   setClass((db ? db->getSchema()->getClass("database_property_value") : DBPropertyValue_Class));
02218 
02219   eyedb::Size idr_psize;
02220   getClass()->getIDRObjectSize(&idr_psize);
02221   if (!share)
02222     {
02223       headerCode(eyedb::_Struct_Type, idr_psize, IDB_XINFO_LOCAL_OBJ);
02224       eyedb::ClassPeer::newObjRealize(getClass(), this);
02225     }
02226 
02227   eyedb::ObjectPeer::setGRTObject(this, eyedb::True);
02228   userCopy(*x);
02229 }
02230 
02231 DBPropertyValue::DBPropertyValue(const DBPropertyValue *x, eyedb::Bool share) : eyedb::Struct(x, share)
02232 {
02233   setClass((db ? db->getSchema()->getClass("database_property_value") : DBPropertyValue_Class));
02234 
02235   eyedb::Size idr_psize;
02236   getClass()->getIDRObjectSize(&idr_psize);
02237   if (!share)
02238     {
02239       headerCode(eyedb::_Struct_Type, idr_psize, IDB_XINFO_LOCAL_OBJ);
02240       eyedb::ClassPeer::newObjRealize(getClass(), this);
02241     }
02242 
02243   eyedb::ObjectPeer::setGRTObject(this, eyedb::True);
02244   userCopy(*x);
02245 }
02246 
02247 eyedb::Status DBPropertyValue::ival(eyedblib::int64 _ival)
02248 {
02249   eyedb::gbxAutoGarbSuspender _gbxsusp_;
02250   eyedb::Status status;
02251 
02252   status = getClass()->getAttributes()[2]->setValue(this, (eyedb::Data)&_ival, 1, 0);
02253   return status;
02254 }
02255 
02256 eyedblib::int64 DBPropertyValue::ival(eyedb::Bool *isnull, eyedb::Status *rs) const
02257 {
02258   eyedb::gbxAutoGarbSuspender _gbxsusp_;
02259   eyedblib::int64 __tmp = 0;
02260   eyedb::Status s;
02261 
02262   s = getClass()->getAttributes()[2]->getValue(this, (eyedb::Data *)&__tmp, 1, 0, isnull);
02263   if (s) {if (rs) *rs = s; return 0;}
02264   return __tmp;
02265 }
02266 
02267 eyedb::Status DBPropertyValue::sval(const std::string &_sval)
02268 {
02269   eyedb::gbxAutoGarbSuspender _gbxsusp_;
02270   eyedb::Status status;
02271   eyedb::Size size;
02272   eyedb::Size len = _sval.size() + 1;
02273 
02274   status = getClass()->getAttributes()[3]->getSize(this, size);
02275   if (status)
02276     return status;
02277 
02278   if (size != len)
02279     status = getClass()->getAttributes()[3]->setSize(this, len);
02280   if (status)
02281     return status;
02282 
02283   status = getClass()->getAttributes()[3]->setValue(this, (eyedb::Data)_sval.c_str(), len, 0);
02284   return status;
02285 
02286 }
02287 
02288 eyedb::Status DBPropertyValue::sval(unsigned int a0, char _sval)
02289 {
02290   eyedb::gbxAutoGarbSuspender _gbxsusp_;
02291   eyedb::Status status;
02292   eyedb::Size from = a0;
02293 
02294   eyedb::Size size;
02295   status = getClass()->getAttributes()[3]->getSize(this, size);
02296   if (status)
02297     return status;
02298 
02299   if (size <= from)
02300     status = getClass()->getAttributes()[3]->setSize(this, from+1);
02301   if (status)
02302     return status;
02303 
02304   status = getClass()->getAttributes()[3]->setValue(this, (eyedb::Data)&_sval, 1, from);
02305   return status;
02306 }
02307 
02308 std::string DBPropertyValue::sval(eyedb::Bool *isnull, eyedb::Status *rs) const
02309 {
02310   eyedb::gbxAutoGarbSuspender _gbxsusp_;
02311   eyedb::Data data;
02312   eyedb::Status s;
02313 
02314   s = getClass()->getAttributes()[3]->getValue(this, (eyedb::Data *)&data, eyedb::Attribute::directAccess, 0, isnull);
02315   if (s) {if (rs) *rs = s; return 0;}
02316   if (!data) data = nulldata;
02317   return (const char *)data;
02318 }
02319 
02320 char DBPropertyValue::sval(unsigned int a0, eyedb::Bool *isnull, eyedb::Status *rs) const
02321 {
02322   eyedb::gbxAutoGarbSuspender _gbxsusp_;
02323   char __tmp = 0;
02324   eyedb::Status s;
02325   eyedb::Size from = a0;
02326 
02327   s = getClass()->getAttributes()[3]->getValue(this, (eyedb::Data *)&__tmp, 1, from, isnull);
02328   if (s) {if (rs) *rs = s; return 0;}
02329   return __tmp;
02330 }
02331 
02332 eyedb::Status DBPropertyValue::bval(const unsigned char *_bval, unsigned int len)
02333 {
02334   eyedb::gbxAutoGarbSuspender _gbxsusp_;
02335   eyedb::Status status;
02336   eyedb::Size size;
02337   status = getClass()->getAttributes()[4]->getSize(this, size);
02338   if (status)
02339     return status;
02340 
02341   if (size != len)
02342     status = getClass()->getAttributes()[4]->setSize(this, len);
02343   if (status)
02344     return status;
02345 
02346   status = getClass()->getAttributes()[4]->setValue(this, (eyedb::Data)_bval, len, 0);
02347   return status;
02348 
02349 }
02350 
02351 eyedb::Status DBPropertyValue::bval(unsigned int a0, unsigned char _bval)
02352 {
02353   eyedb::gbxAutoGarbSuspender _gbxsusp_;
02354   eyedb::Status status;
02355   eyedb::Size from = a0;
02356 
02357   eyedb::Size size;
02358   status = getClass()->getAttributes()[4]->getSize(this, size);
02359   if (status)
02360     return status;
02361 
02362   if (size <= from)
02363     status = getClass()->getAttributes()[4]->setSize(this, from+1);
02364   if (status)
02365     return status;
02366 
02367   status = getClass()->getAttributes()[4]->setValue(this, (eyedb::Data)&_bval, 1, from);
02368   return status;
02369 }
02370 
02371 eyedb::Status DBPropertyValue::bval_cnt(unsigned int a0)
02372 {
02373   eyedb::gbxAutoGarbSuspender _gbxsusp_;
02374   eyedb::Status status;
02375   eyedb::Size from = a0;
02376   status = getClass()->getAttributes()[4]->setSize(this, from);
02377   return status;
02378 }
02379 
02380 const unsigned char *DBPropertyValue::bval(unsigned int *len, eyedb::Bool *isnull, eyedb::Status *rs) const
02381 {
02382   eyedb::gbxAutoGarbSuspender _gbxsusp_;
02383   eyedb::Data data;
02384   eyedb::Status s;
02385 
02386   s = getClass()->getAttributes()[4]->getValue(this, (eyedb::Data *)&data, eyedb::Attribute::directAccess, 0, isnull);
02387   if (s) {if (rs) *rs = s; return 0;}
02388   if (!data) data = nulldata;
02389   if (len) *len = bval_cnt();
02390   return (const unsigned char *)data;
02391 }
02392 
02393 unsigned char DBPropertyValue::bval(unsigned int a0, eyedb::Bool *isnull, eyedb::Status *rs) const
02394 {
02395   eyedb::gbxAutoGarbSuspender _gbxsusp_;
02396   unsigned char __tmp = 0;
02397   eyedb::Status s;
02398   eyedb::Size from = a0;
02399 
02400   s = getClass()->getAttributes()[4]->getValue(this, (eyedb::Data *)&__tmp, 1, from, isnull);
02401   if (s) {if (rs) *rs = s; return 0;}
02402   return __tmp;
02403 }
02404 
02405 unsigned int DBPropertyValue::bval_cnt(eyedb::Status *rs) const
02406 {
02407   eyedb::gbxAutoGarbSuspender _gbxsusp_;
02408   eyedb::Size size;
02409   eyedb::Status s;
02410   s = getClass()->getAttributes()[4]->getSize(this, size);
02411   if (s) {if (rs) *rs = s; return 0;}
02412   return (int)size;
02413 }
02414 
02415 eyedb::Status DBPropertyValue::oval(eyedb::Object*_oval)
02416 {
02417   eyedb::gbxAutoGarbSuspender _gbxsusp_;
02418   eyedb::Status status;
02419 
02420   eyedb::Object *_ooval = _oval;
02421 
02422   status = getClass()->getAttributes()[5]->setValue(this, (eyedb::Data)&_ooval, 1, 0);
02423   return status;
02424 }
02425 
02426 const eyedb::Object*DBPropertyValue::oval(eyedb::Bool *isnull, eyedb::Status *rs) const 
02427 {
02428   eyedb::gbxAutoGarbSuspender _gbxsusp_;
02429   eyedb::Object *__o = 0, *__go;
02430   eyedb::Status s;
02431 
02432   s = getClass()->getAttributes()[5]->getValue(this, (eyedb::Data *)&__o, 1, 0, isnull);
02433   if (s) {if (rs) *rs = s; return 0;}
02434 
02435   if (__o)
02436     {
02437      if (eyedb::ObjectPeer::isGRTObject(__o)) {
02438        return (eyedb::Object *)__o;
02439      }
02440      __go = (eyedb::Object *)make_object(__o, eyedb::False);
02441      if (__go)
02442       {
02443        __o = __go;
02444        s = getClass()->getAttributes()[5]->setValue((Agregat *)this, (eyedb::Data)&__o, 1, 0);
02445        eyedb::ObjectPeer::decrRefCount(__o);
02446        if (s) {if (rs) *rs = s; return 0;}
02447       }
02448      return (eyedb::Object*)__o;
02449     }
02450 
02451   eyedb::Bool wasnull = (!__o ? eyedb::True : eyedb::False);
02452   if (!__o && db)
02453     {
02454       eyedb::Oid toid;
02455       s = getClass()->getAttributes()[5]->getOid(this, &toid, 1, 0);
02456       if (s) {if (rs) *rs = s; return 0;}
02457       if (toid.isValid())
02458         {
02459           s = db->loadObject(&toid, &__o);
02460           if (s) {if (rs) *rs = s; return 0;}
02461           if (!eyedb::ObjectPeer::isGRTObject(__o))
02462            {
02463              __go = (eyedb::Object *)make_object(__o, eyedb::False);
02464              if (__go) __o = __go;
02465            }
02466         }
02467     }
02468 
02469   if (__o && wasnull)
02470     {
02471      s = getClass()->getAttributes()[5]->setValue((eyedb::Agregat *)this, (eyedb::Data)&__o, 1, 0);
02472      if (s) {if (rs) *rs = s; return 0;}
02473      __o->release();
02474     }
02475   return (eyedb::Object*)__o;
02476 }
02477 
02478 eyedb::Object*DBPropertyValue::oval(eyedb::Bool *isnull, eyedb::Status *rs) 
02479 {
02480   eyedb::gbxAutoGarbSuspender _gbxsusp_;
02481   eyedb::Object *__o = 0, *__go;
02482   eyedb::Status s;
02483 
02484   s = getClass()->getAttributes()[5]->getValue(this, (eyedb::Data *)&__o, 1, 0, isnull);
02485   if (s) {if (rs) *rs = s; return 0;}
02486 
02487   if (__o)
02488     {
02489      if (eyedb::ObjectPeer::isGRTObject(__o)) {
02490        return (eyedb::Object *)__o;
02491      }
02492      __go = (eyedb::Object *)make_object(__o, eyedb::False);
02493      if (__go)
02494       {
02495        __o = __go;
02496        s = getClass()->getAttributes()[5]->setValue((Agregat *)this, (eyedb::Data)&__o, 1, 0);
02497        eyedb::ObjectPeer::decrRefCount(__o);
02498        if (s) {if (rs) *rs = s; return 0;}
02499       }
02500      return (eyedb::Object*)__o;
02501     }
02502 
02503   eyedb::Bool wasnull = (!__o ? eyedb::True : eyedb::False);
02504   if (!__o && db)
02505     {
02506       eyedb::Oid toid;
02507       s = getClass()->getAttributes()[5]->getOid(this, &toid, 1, 0);
02508       if (s) {if (rs) *rs = s; return 0;}
02509       if (toid.isValid())
02510         {
02511           s = db->loadObject(&toid, &__o);
02512           if (s) {if (rs) *rs = s; return 0;}
02513           if (!eyedb::ObjectPeer::isGRTObject(__o))
02514            {
02515              __go = (eyedb::Object *)make_object(__o, eyedb::False);
02516              if (__go) __o = __go;
02517            }
02518         }
02519     }
02520 
02521   if (__o && wasnull)
02522     {
02523      s = getClass()->getAttributes()[5]->setValue((eyedb::Agregat *)this, (eyedb::Data)&__o, 1, 0);
02524      if (s) {if (rs) *rs = s; return 0;}
02525      __o->release();
02526     }
02527   return (eyedb::Object*)__o;
02528 }
02529 
02530 eyedb::Status DBPropertyValue::oval_oid(const eyedb::Oid &_oid)
02531 {
02532   eyedb::gbxAutoGarbSuspender _gbxsusp_;
02533   eyedb::Status status;
02534 
02535   status = getClass()->getAttributes()[5]->setOid(this, &_oid, 1, 0, oid_check);
02536   return status;
02537 }
02538 
02539 eyedb::Oid DBPropertyValue::oval_oid(eyedb::Status *rs) const
02540 {
02541   eyedb::gbxAutoGarbSuspender _gbxsusp_;
02542   eyedb::Oid __tmp;
02543   eyedb::Status s;
02544 
02545   s = getClass()->getAttributes()[5]->getOid(this, &__tmp, 1, 0);
02546   if (s) {if (rs) *rs = s; return nulloid;}
02547 
02548   return __tmp;
02549 }
02550 
02551 static const eyedb::Attribute **DBProperty_agritems;
02552 static eyedb::Size DBProperty_idr_objsz, DBProperty_idr_psize;
02553 
02554 static eyedb::StructClass *DBProperty_make(eyedb::StructClass *DBProperty_class = 0, eyedb::Schema *m = 0)
02555 {
02556   if (!DBProperty_class)
02557     return new eyedb::StructClass("database_property", (m ? m->getClass("struct") : eyedb::Struct_Class));
02558   eyedb::Attribute *attr[4];
02559   int *dims;
02560 
02561   dims = new int[1];
02562   dims[0] = -1;
02563   attr[2] = new eyedb::Attribute((m ? m->getClass("char") : eyedb::Char_Class), "key", eyedb::False, 1, dims);
02564   delete[] dims;
02565 
02566   dims = 0;
02567   attr[3] = new eyedb::Attribute((m ? m->getClass("database_property_value") : DBPropertyValue_Class), "value", eyedb::False, 0, dims);
02568 
02569   DBProperty_class->setAttributes(&attr[2], 2);
02570 
02571   delete attr[2];
02572   delete attr[3];
02573 
02574 
02575   return DBProperty_class;
02576 }
02577 
02578 eyedb::Object *DBProperty_construct_x(const eyedb::Class *cls, eyedb::Data idr)
02579 {
02580   return new DBProperty(cls, idr);
02581 }
02582 
02583 eyedb::Object *DBProperty_construct(const eyedb::Object *o, eyedb::Bool share)
02584 {
02585   return new DBProperty((const eyedb::Struct *)o, share);
02586 }
02587 
02588 static void DBProperty_init_p()
02589 {
02590   DBProperty_Class = DBProperty_make();
02591   constructors_x[class_ind] = DBProperty_construct_x;
02592   constructors[class_ind] = DBProperty_construct;
02593   hash->insert("database_property", class_ind++);
02594 }
02595 
02596 static void DBProperty_init()
02597 {
02598   DBProperty_make(DBProperty_Class);
02599 
02600   DBProperty_agritems = DBProperty_Class->getAttributes();
02601   DBProperty_idr_objsz = DBProperty_Class->getIDRObjectSize(&DBProperty_idr_psize, 0);
02602 
02603   eyedb::ObjectPeer::setUnrealizable(DBProperty_Class, eyedb::True);
02604 }
02605 
02606 static eyedb::Status DBProperty_attrcomp_realize(eyedb::Database *db, eyedb::Class *cls)
02607 {
02608   eyedb::AttributeComponent *comp;
02609   const eyedb::Dataspace *dataspace;
02610   eyedb::ClassComponent *clcomp;
02611   eyedb::Status status;
02612   int *impl_hints;
02613   impl_hints = new int[8];
02614   impl_hints[0] = 0;
02615   impl_hints[1] = 0;
02616   impl_hints[2] = 0;
02617   impl_hints[3] = 0;
02618   impl_hints[4] = 0;
02619   impl_hints[5] = 0;
02620   impl_hints[6] = 0;
02621   impl_hints[7] = 0;
02622   dataspace = 0;;
02623   comp = new eyedb::HashIndex(db, cls, "database_property.key", eyedb::True, eyedb::True, dataspace, 0, 0, impl_hints, 8);
02624   delete [] impl_hints;
02625   cls->add(comp->getInd(), comp);
02626 
02627   return eyedb::Success;
02628 }
02629 
02630 DBProperty::DBProperty(eyedb::Database *_db, const eyedb::Dataspace *_dataspace) : eyedb::Struct(_db, _dataspace)
02631 {
02632   initialize(_db);
02633 }
02634 
02635 DBProperty::DBProperty(const eyedb::Class *_cls, eyedb::Data _idr)
02636 {
02637   setClass((eyedb::Class *)_cls);
02638 
02639   eyedb::Size idr_psize;
02640   eyedb::Size idr_tsize = getClass()->getIDRObjectSize(&idr_psize);
02641   if (_idr)
02642     idr->setIDR(idr_tsize, _idr);
02643   else
02644     {
02645       idr->setIDR(idr_tsize);
02646       memset(idr->getIDR() + IDB_OBJ_HEAD_SIZE, 0, idr->getSize() - IDB_OBJ_HEAD_SIZE);
02647     }
02648   headerCode(eyedb::_Struct_Type, idr_psize, IDB_XINFO_LOCAL_OBJ);
02649   eyedb::ClassPeer::newObjRealize(getClass(), this);
02650   eyedb::ObjectPeer::setGRTObject(this, eyedb::True);
02651   userInitialize();
02652 }
02653 
02654 void DBProperty::initialize(eyedb::Database *_db)
02655 {
02656   setClass((_db ? _db->getSchema()->getClass("database_property") : DBProperty_Class));
02657 
02658   eyedb::Size idr_psize;
02659   idr->setIDR(getClass()->getIDRObjectSize(&idr_psize));
02660   memset(idr->getIDR() + IDB_OBJ_HEAD_SIZE, 0, idr->getSize() - IDB_OBJ_HEAD_SIZE);
02661   headerCode(eyedb::_Struct_Type, idr_psize, IDB_XINFO_LOCAL_OBJ);
02662   eyedb::ClassPeer::newObjRealize(getClass(), this);
02663   eyedb::ObjectPeer::setGRTObject(this, eyedb::True);
02664   userInitialize();
02665 }
02666 
02667 DBProperty::DBProperty(const DBProperty& x) : eyedb::Struct(x)
02668 {
02669   userCopy(x);
02670 }
02671 
02672 DBProperty& DBProperty::operator=(const DBProperty& x)
02673 {
02674   *(eyedb::Struct *)this = eyedb::Struct::operator=((const eyedb::Struct &)x);
02675   userCopy(x);
02676   return *this;
02677 }
02678 
02679 DBProperty::DBProperty(const eyedb::Struct *x, eyedb::Bool share) : eyedb::Struct(x, share)
02680 {
02681   setClass((db ? db->getSchema()->getClass("database_property") : DBProperty_Class));
02682 
02683   eyedb::Size idr_psize;
02684   getClass()->getIDRObjectSize(&idr_psize);
02685   if (!share)
02686     {
02687       headerCode(eyedb::_Struct_Type, idr_psize, IDB_XINFO_LOCAL_OBJ);
02688       eyedb::ClassPeer::newObjRealize(getClass(), this);
02689     }
02690 
02691   eyedb::ObjectPeer::setGRTObject(this, eyedb::True);
02692   userCopy(*x);
02693 }
02694 
02695 DBProperty::DBProperty(const DBProperty *x, eyedb::Bool share) : eyedb::Struct(x, share)
02696 {
02697   setClass((db ? db->getSchema()->getClass("database_property") : DBProperty_Class));
02698 
02699   eyedb::Size idr_psize;
02700   getClass()->getIDRObjectSize(&idr_psize);
02701   if (!share)
02702     {
02703       headerCode(eyedb::_Struct_Type, idr_psize, IDB_XINFO_LOCAL_OBJ);
02704       eyedb::ClassPeer::newObjRealize(getClass(), this);
02705     }
02706 
02707   eyedb::ObjectPeer::setGRTObject(this, eyedb::True);
02708   userCopy(*x);
02709 }
02710 
02711 eyedb::Status DBProperty::key(const std::string &_key)
02712 {
02713   eyedb::gbxAutoGarbSuspender _gbxsusp_;
02714   eyedb::Status status;
02715   eyedb::Size size;
02716   eyedb::Size len = _key.size() + 1;
02717 
02718   status = getClass()->getAttributes()[2]->getSize(this, size);
02719   if (status)
02720     return status;
02721 
02722   if (size != len)
02723     status = getClass()->getAttributes()[2]->setSize(this, len);
02724   if (status)
02725     return status;
02726 
02727   status = getClass()->getAttributes()[2]->setValue(this, (eyedb::Data)_key.c_str(), len, 0);
02728   return status;
02729 
02730 }
02731 
02732 eyedb::Status DBProperty::key(unsigned int a0, char _key)
02733 {
02734   eyedb::gbxAutoGarbSuspender _gbxsusp_;
02735   eyedb::Status status;
02736   eyedb::Size from = a0;
02737 
02738   eyedb::Size size;
02739   status = getClass()->getAttributes()[2]->getSize(this, size);
02740   if (status)
02741     return status;
02742 
02743   if (size <= from)
02744     status = getClass()->getAttributes()[2]->setSize(this, from+1);
02745   if (status)
02746     return status;
02747 
02748   status = getClass()->getAttributes()[2]->setValue(this, (eyedb::Data)&_key, 1, from);
02749   return status;
02750 }
02751 
02752 std::string DBProperty::key(eyedb::Bool *isnull, eyedb::Status *rs) const
02753 {
02754   eyedb::gbxAutoGarbSuspender _gbxsusp_;
02755   eyedb::Data data;
02756   eyedb::Status s;
02757 
02758   s = getClass()->getAttributes()[2]->getValue(this, (eyedb::Data *)&data, eyedb::Attribute::directAccess, 0, isnull);
02759   if (s) {if (rs) *rs = s; return 0;}
02760   if (!data) data = nulldata;
02761   return (const char *)data;
02762 }
02763 
02764 char DBProperty::key(unsigned int a0, eyedb::Bool *isnull, eyedb::Status *rs) const
02765 {
02766   eyedb::gbxAutoGarbSuspender _gbxsusp_;
02767   char __tmp = 0;
02768   eyedb::Status s;
02769   eyedb::Size from = a0;
02770 
02771   s = getClass()->getAttributes()[2]->getValue(this, (eyedb::Data *)&__tmp, 1, from, isnull);
02772   if (s) {if (rs) *rs = s; return 0;}
02773   return __tmp;
02774 }
02775 
02776 eyedb::Status DBProperty::value(DBPropertyValue*_value)
02777 {
02778   eyedb::gbxAutoGarbSuspender _gbxsusp_;
02779   eyedb::Status status;
02780 
02781   eyedb::Object *_ovalue = _value;
02782 
02783   status = getClass()->getAttributes()[3]->setValue(this, (eyedb::Data)&_ovalue, 1, 0);
02784   return status;
02785 }
02786 
02787 const DBPropertyValue*DBProperty::value(eyedb::Bool *isnull, eyedb::Status *rs) const 
02788 {
02789   eyedb::gbxAutoGarbSuspender _gbxsusp_;
02790   eyedb::Object *__o = 0, *__go;
02791   eyedb::Status s;
02792 
02793   s = getClass()->getAttributes()[3]->getValue(this, (eyedb::Data *)&__o, 1, 0, isnull);
02794   if (s) {if (rs) *rs = s; return 0;}
02795 
02796   if (__o)
02797     {
02798      if (eyedb::ObjectPeer::isGRTObject(__o)) {
02799        return (DBPropertyValue *)__o;
02800      }
02801      __go = (DBPropertyValue *)make_object(__o, eyedb::False);
02802      if (__go)
02803       {
02804        __o = __go;;
02805        s = getClass()->getAttributes()[3]->setValue((Agregat *)this, (eyedb::Data)&__o, 1, 0);
02806        eyedb::ObjectPeer::decrRefCount(__o);
02807        if (s) {if (rs) *rs = s; return 0;}
02808       }
02809     }
02810   return (DBPropertyValue*)__o;
02811 }
02812 
02813 DBPropertyValue*DBProperty::value(eyedb::Bool *isnull, eyedb::Status *rs) 
02814 {
02815   eyedb::gbxAutoGarbSuspender _gbxsusp_;
02816   eyedb::Object *__o = 0, *__go;
02817   eyedb::Status s;
02818 
02819   s = getClass()->getAttributes()[3]->getValue(this, (eyedb::Data *)&__o, 1, 0, isnull);
02820   if (s) {if (rs) *rs = s; return 0;}
02821 
02822   if (__o)
02823     {
02824      if (eyedb::ObjectPeer::isGRTObject(__o)) {
02825        return (DBPropertyValue *)__o;
02826      }
02827      __go = (DBPropertyValue *)make_object(__o, eyedb::False);
02828      if (__go)
02829       {
02830        __o = __go;;
02831        s = getClass()->getAttributes()[3]->setValue((Agregat *)this, (eyedb::Data)&__o, 1, 0);
02832        eyedb::ObjectPeer::decrRefCount(__o);
02833        if (s) {if (rs) *rs = s; return 0;}
02834       }
02835     }
02836   return (DBPropertyValue*)__o;
02837 }
02838 
02839 static const char not_exit_msg[] = "class does not exist";
02840 static const char differ_msg[] = "class differs in database and in runtime environment";
02841 
02842 void DBMInit(void)
02843 {
02844   if (hash) return;
02845 
02846   hash = new eyedb::GenHashTable(0, 113);
02847 
02848   SysAccessMode_init_p();
02849   DBAccessMode_init_p();
02850   UserType_init_p();
02851   UserEntry_init_p();
02852   DBUserAccess_init_p();
02853   SysUserAccess_init_p();
02854   DBEntry_init_p();
02855   DBPropertyValue_init_p();
02856   DBProperty_init_p();
02857   SysAccessMode_init();
02858   DBAccessMode_init();
02859   UserType_init();
02860   UserEntry_init();
02861   DBUserAccess_init();
02862   SysUserAccess_init();
02863   DBEntry_init();
02864   DBPropertyValue_init();
02865   DBProperty_init();
02866 }
02867 
02868 void DBMRelease(void)
02869 {
02870   if (!hash) return;
02871 
02872   delete hash;
02873   hash = 0;
02874 
02875   SysAccessMode_Class->release();
02876   DBAccessMode_Class->release();
02877   UserType_Class->release();
02878   UserEntry_Class->release();
02879   DBUserAccess_Class->release();
02880   SysUserAccess_Class->release();
02881   DBEntry_Class->release();
02882   DBPropertyValue_Class->release();
02883   DBProperty_Class->release();
02884 }
02885 
02886 static eyedb::Status
02887 DBMSchemaUpdate(eyedb::Schema *m, eyedb::Database *db)
02888 {
02889   m->setName("eyedbdbm");
02890   eyedb::Status status;
02891   eyedb::EnumClass *SysAccessMode_class = SysAccessMode_make(0, m);
02892   if (!m->getClass("system_access_mode"))
02893     {
02894       status = m->addClass(SysAccessMode_class);
02895       if (status)
02896         return status;
02897     }
02898   eyedb::EnumClass *DBAccessMode_class = DBAccessMode_make(0, m);
02899   if (!m->getClass("database_access_mode"))
02900     {
02901       status = m->addClass(DBAccessMode_class);
02902       if (status)
02903         return status;
02904     }
02905   eyedb::EnumClass *UserType_class = UserType_make(0, m);
02906   if (!m->getClass("user_type"))
02907     {
02908       status = m->addClass(UserType_class);
02909       if (status)
02910         return status;
02911     }
02912   eyedb::StructClass *UserEntry_class = UserEntry_make(0, m);
02913   if (!m->getClass("user_entry"))
02914     {
02915       status = m->addClass(UserEntry_class);
02916       if (status)
02917         return status;
02918     }
02919   eyedb::StructClass *DBUserAccess_class = DBUserAccess_make(0, m);
02920   if (!m->getClass("database_user_access"))
02921     {
02922       status = m->addClass(DBUserAccess_class);
02923       if (status)
02924         return status;
02925     }
02926   eyedb::StructClass *SysUserAccess_class = SysUserAccess_make(0, m);
02927   if (!m->getClass("system_user_access"))
02928     {
02929       status = m->addClass(SysUserAccess_class);
02930       if (status)
02931         return status;
02932     }
02933   eyedb::StructClass *DBEntry_class = DBEntry_make(0, m);
02934   if (!m->getClass("database_entry"))
02935     {
02936       status = m->addClass(DBEntry_class);
02937       if (status)
02938         return status;
02939     }
02940   eyedb::StructClass *DBPropertyValue_class = DBPropertyValue_make(0, m);
02941   if (!m->getClass("database_property_value"))
02942     {
02943       status = m->addClass(DBPropertyValue_class);
02944       if (status)
02945         return status;
02946     }
02947   eyedb::StructClass *DBProperty_class = DBProperty_make(0, m);
02948   if (!m->getClass("database_property"))
02949     {
02950       status = m->addClass(DBProperty_class);
02951       if (status)
02952         return status;
02953     }
02954 
02955   SysAccessMode_make(SysAccessMode_class, m);
02956   DBAccessMode_make(DBAccessMode_class, m);
02957   UserType_make(UserType_class, m);
02958   UserEntry_make(UserEntry_class, m);
02959   DBUserAccess_make(DBUserAccess_class, m);
02960   SysUserAccess_make(SysUserAccess_class, m);
02961   DBEntry_make(DBEntry_class, m);
02962   DBPropertyValue_make(DBPropertyValue_class, m);
02963   DBProperty_make(DBProperty_class, m);
02964 
02965   if (!db) return eyedb::Success;
02966 
02967   if (!SysAccessMode_class->compare(m->getClass("system_access_mode")))
02968     return eyedb::Exception::make(eyedb::IDB_ERROR, "'SysAccessMode' %s", differ_msg);
02969   if (!DBAccessMode_class->compare(m->getClass("database_access_mode")))
02970     return eyedb::Exception::make(eyedb::IDB_ERROR, "'DBAccessMode' %s", differ_msg);
02971   if (!UserType_class->compare(m->getClass("user_type")))
02972     return eyedb::Exception::make(eyedb::IDB_ERROR, "'UserType' %s", differ_msg);
02973   if (!UserEntry_class->compare(m->getClass("user_entry")))
02974     return eyedb::Exception::make(eyedb::IDB_ERROR, "'UserEntry' %s", differ_msg);
02975   if (!DBUserAccess_class->compare(m->getClass("database_user_access")))
02976     return eyedb::Exception::make(eyedb::IDB_ERROR, "'DBUserAccess' %s", differ_msg);
02977   if (!SysUserAccess_class->compare(m->getClass("system_user_access")))
02978     return eyedb::Exception::make(eyedb::IDB_ERROR, "'SysUserAccess' %s", differ_msg);
02979   if (!DBEntry_class->compare(m->getClass("database_entry")))
02980     return eyedb::Exception::make(eyedb::IDB_ERROR, "'DBEntry' %s", differ_msg);
02981   if (!DBPropertyValue_class->compare(m->getClass("database_property_value")))
02982     return eyedb::Exception::make(eyedb::IDB_ERROR, "'DBPropertyValue' %s", differ_msg);
02983   if (!DBProperty_class->compare(m->getClass("database_property")))
02984     return eyedb::Exception::make(eyedb::IDB_ERROR, "'DBProperty' %s", differ_msg);
02985 
02986   db->transactionBegin();
02987 
02988   if ((status = UserEntry_attrcomp_realize(db, m->getClass("user_entry")))) return status;
02989 
02990   if ((status = DBUserAccess_attrcomp_realize(db, m->getClass("database_user_access")))) return status;
02991 
02992   if ((status = SysUserAccess_attrcomp_realize(db, m->getClass("system_user_access")))) return status;
02993 
02994   if ((status = DBEntry_attrcomp_realize(db, m->getClass("database_entry")))) return status;
02995 
02996   if ((status = DBPropertyValue_attrcomp_realize(db, m->getClass("database_property_value")))) return status;
02997 
02998   if ((status = DBProperty_attrcomp_realize(db, m->getClass("database_property")))) return status;
02999   status = m->realize();
03000   if (status) return status;
03001   db->transactionCommit();
03002   return eyedb::Success;
03003 }
03004 
03005 eyedb::Status DBMSchemaUpdate(eyedb::Database *db)
03006 {
03007   return DBMSchemaUpdate(db->getSchema(), db);
03008 }
03009 
03010 eyedb::Status DBMSchemaUpdate(eyedb::Schema *m)
03011 {
03012   return DBMSchemaUpdate(m, NULL);
03013 }
03014 
03015 eyedb::Object *DBMMakeObject(eyedb::Object *o, eyedb::Bool remove)
03016 {
03017   if (!o->getClass()) return (eyedb::Object *)0;
03018   if (eyedb::ObjectPeer::isGRTObject(o))
03019     return o;
03020   int ind = hash->get(o->getClass()->getName());
03021   if (ind < 0 && (!o->getClass()->getStrictAliasName() || (ind = hash->get(o->getClass()->getStrictAliasName())) < 0)) return 0;
03022   eyedb::Object *co = constructors[ind](o, (remove ? eyedb::True : eyedb::False));
03023   eyedb::ObjectPeer::setClass(co, o->getClass());
03024   if (remove) o->release();
03025   if (co->getDatabase())
03026     co->getDatabase()->cacheObject(co);
03027   return co;
03028 }
03029 
03030 DBMDatabase::DBMDatabase(eyedb::Connection *conn, const char *dbname, eyedb::Database::OpenFlag flag, const char *userauth, const char *passwdauth) : eyedb::Database(dbname)
03031 {
03032   eyedb::Status status = open(conn, flag, 0, userauth, passwdauth);
03033   if (status) throw *status;
03034 }
03035 
03036 DBMDatabase::DBMDatabase(eyedb::Connection *conn, const char *dbname, const char *dbmdb_str, eyedb::Database::OpenFlag flag, const char *userauth, const char *passwdauth) : eyedb::Database(dbname, dbmdb_str)
03037 {
03038   eyedb::Status status = open(conn, flag, 0, userauth, passwdauth);
03039   if (status) throw *status;
03040 }
03041 
03042 eyedb::Status DBMDatabase::open(eyedb::Connection *conn, eyedb::Database::OpenFlag flag, const char *userauth, const char *passwdauth)
03043 {
03044   return open(conn, flag, 0, userauth, passwdauth);
03045 }
03046 
03047 eyedb::Status DBMDatabase::open(eyedb::Connection *conn, eyedb::Database::OpenFlag flag, const eyedb::OpenHints *hints, const char *userauth, const char *passwdauth)
03048 {
03049   eyedb::Status status = eyedb::Database::open(conn, flag, hints, userauth, passwdauth);
03050   if (status) return status;
03051   transactionBegin();
03052   status = DBMDatabase::checkSchema(getSchema());
03053   transactionCommit();
03054 
03055   if (!status) add(hash, constructors_x);
03056 
03057   return status;
03058 }
03059 
03060 void DBMDatabase::setConsApp(eyedb::Database *_db)
03061 {
03062   _db->add(hash, constructors_x);
03063 }
03064 
03065 static void append(char *&s, const char *m1, const char *m2)
03066 {
03067   if (!s) {s = (char *)malloc(strlen(m1)+strlen(m2)+2); *s = 0;}
03068   else s = (char *)realloc(s, strlen(s)+strlen(m1)+strlen(m2)+2);
03069   strcat(s, m1);
03070   strcat(s, m2);
03071   strcat(s, "\n");
03072 }
03073 
03074 eyedb::Bool DBMDatabase::getDynamicGetErrorPolicy() {
03075    throw *eyedb::Exception::make(eyedb::IDB_ERROR, "getDynamicGetErrorPolicy() can be called only when the dynamic attribute fonctionnality is on (-dynamic-attr option of eyedbodl)");
03076 }
03077 
03078 eyedb::Bool DBMDatabase::getDynamicSetErrorPolicy() {
03079    throw *eyedb::Exception::make(eyedb::IDB_ERROR, "getDynamicSetErrorPolicy() can be called only when the dynamic attribute fonctionnality is on (-dynamic-attr option of eyedbodl)");
03080 }
03081 
03082 void DBMDatabase::setDynamicGetErrorPolicy(eyedb::Bool policy) {
03083    throw *eyedb::Exception::make(eyedb::IDB_ERROR, "setDynamicGetErrorPolicy() can be called only when the dynamic attribute fonctionnality is on (-dynamic-attr option of eyedbodl)");
03084 }
03085 
03086 void DBMDatabase::setDynamicSetErrorPolicy(eyedb::Bool policy) {
03087    throw *eyedb::Exception::make(eyedb::IDB_ERROR, "setDynamicSetErrorPolicy() can be called only when the dynamic attribute fonctionnality is on (-dynamic-attr option of eyedbodl)");
03088 }
03089 
03090 eyedb::Status DBMDatabase::checkSchema(eyedb::Schema *m)
03091 {
03092   eyedb::Class *cl;
03093   char *s = 0;
03094 
03095   if (!(cl = m->getClass("system_access_mode")))
03096     append(s, "'system_access_mode' ", not_exit_msg);
03097   else if (!SysAccessMode_Class->compare(cl))
03098     append(s, "'SysAccessMode' ", differ_msg);
03099   if (!(cl = m->getClass("database_access_mode")))
03100     append(s, "'database_access_mode' ", not_exit_msg);
03101   else if (!DBAccessMode_Class->compare(cl))
03102     append(s, "'DBAccessMode' ", differ_msg);
03103   if (!(cl = m->getClass("user_type")))
03104     append(s, "'user_type' ", not_exit_msg);
03105   else if (!UserType_Class->compare(cl))
03106     append(s, "'UserType' ", differ_msg);
03107   if (!(cl = m->getClass("user_entry")))
03108     append(s, "'user_entry' ", not_exit_msg);
03109   else if (!UserEntry_Class->compare(cl))
03110     append(s, "'UserEntry' ", differ_msg);
03111   if (!(cl = m->getClass("database_user_access")))
03112     append(s, "'database_user_access' ", not_exit_msg);
03113   else if (!DBUserAccess_Class->compare(cl))
03114     append(s, "'DBUserAccess' ", differ_msg);
03115   if (!(cl = m->getClass("system_user_access")))
03116     append(s, "'system_user_access' ", not_exit_msg);
03117   else if (!SysUserAccess_Class->compare(cl))
03118     append(s, "'SysUserAccess' ", differ_msg);
03119   if (!(cl = m->getClass("database_entry")))
03120     append(s, "'database_entry' ", not_exit_msg);
03121   else if (!DBEntry_Class->compare(cl))
03122     append(s, "'DBEntry' ", differ_msg);
03123   if (!(cl = m->getClass("database_property_value")))
03124     append(s, "'database_property_value' ", not_exit_msg);
03125   else if (!DBPropertyValue_Class->compare(cl))
03126     append(s, "'DBPropertyValue' ", differ_msg);
03127   if (!(cl = m->getClass("database_property")))
03128     append(s, "'database_property' ", not_exit_msg);
03129   else if (!DBProperty_Class->compare(cl))
03130     append(s, "'DBProperty' ", differ_msg);
03131   if (s) {eyedb::Status status = eyedb::Exception::make(s); free(s); return status;}
03132   return eyedb::Success;
03133 }
03134 
03135 eyedb::Bool DBM_set_oid_check(eyedb::Bool _oid_check)
03136 {
03137   eyedb::Bool old = oid_check;
03138   oid_check = _oid_check;
03139   return old;
03140 }
03141 
03142 eyedb::Bool DBM_get_oid_check()
03143 {
03144   return oid_check;
03145 }
03146 
03147 }

Generated on Mon Dec 22 18:15:53 2008 for eyedb by  doxygen 1.5.3