Database.cpp
Go to the documentation of this file.
1 // Copyright (c) 2005-2014 Code Synthesis Tools CC
2 //
3 // This program was generated by CodeSynthesis XSD, an XML Schema to
4 // C++ data binding compiler.
5 //
6 // This program is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License version 2 as
8 // published by the Free Software Foundation.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 //
19 // In addition, as a special exception, Code Synthesis Tools CC gives
20 // permission to link this program with the Xerces-C++ library (or with
21 // modified versions of Xerces-C++ that use the same license as Xerces-C++),
22 // and distribute linked combinations including the two. You must obey
23 // the GNU General Public License version 2 in all respects for all of
24 // the code used other than Xerces-C++. If you modify this copy of the
25 // program, you may extend this exception to your version of the program,
26 // but you are not obligated to do so. If you do not wish to do so, delete
27 // this exception statement from your version.
28 //
29 // Furthermore, Code Synthesis Tools CC makes a special exception for
30 // the Free/Libre and Open Source Software (FLOSS) which is described
31 // in the accompanying FLOSSE file.
32 //
33 
34 // Begin prologue.
35 //
36 //
37 // End prologue.
38 
39 #include <xsd/cxx/pre.hxx>
40 
41 #include <Database/Database.h>
42 
43 namespace nova
44 {
45  namespace dbi
46  {
47  template <class X>
48  struct copyTraits
49  {
50  static void copyNeededFields(X const& source, X& target) {}
51  template <class Y>
52  static void copyNeededFields(X const& source, Y& target) {}
53  };
54 
55  template <>
57  {
58  static void copyNeededFields(dBCheck_t const& source, dBCheck_t& target) {
59  target.copyNeededFields(source);
60  }
61  template <class Y>
62  static void copyNeededFields(dBCheck_t const& source, Y& target) {
63  target->copyNeededFields(source);
64  }
65  };
66 
67  template <>
69  {
70  static void copyNeededFields(dBColumn_t const& source, dBColumn_t& target) {
71  target.copyNeededFields(source);
72  }
73  template <class Y>
74  static void copyNeededFields(dBColumn_t const& source, Y& target) {
75  target->copyNeededFields(source);
76  }
77  };
78 
79  template <>
81  {
82  static void copyNeededFields(dBRow_t const& source, dBRow_t& target) {
83  target.copyNeededFields(source);
84  }
85  template <class Y>
86  static void copyNeededFields(dBRow_t const& source, Y& target) {
87  target->copyNeededFields(source);
88  }
89  };
90 
91  template <>
93  {
94  static void copyNeededFields(dBTable const& source, dBTable& target) {
95  target.copyNeededFields(source);
96  }
97  template <class Y>
98  static void copyNeededFields(dBTable const& source, Y& target) {
99  target->copyNeededFields(source);
100  }
101  };
102 
103  // dBColumn_t
104  //
105 
107  name () const
108  {
109  return this->name_.get ();
110  }
111 
114  {
115  return this->name_.get ();
116  }
117 
119  getName () const
120  {
121  return this->name_.get ();
122  }
123 
124  bool dBColumn_t::
125  hasName () const
126  {
127  return this->name_.present ();
128  }
129 
130  void dBColumn_t::
131  name (const name_type& x)
132  {
133  this->name_.set (x);
134  }
135 
136  void dBColumn_t::
138  {
139  this->name_.set (x);
140  }
141 
142  void dBColumn_t::
143  name (::std::unique_ptr< name_type > x)
144  {
145  this->name_.set (std::move (x));
146  }
147 
149  colType () const
150  {
151  return this->colType_;
152  }
153 
156  {
157  return this->colType_;
158  }
159 
161  getColType () const
162  {
163  return this->colType_.get ();
164  }
165 
166  bool dBColumn_t::
167  hasColType () const
168  {
169  return this->colType_.present ();
170  }
171 
172  void dBColumn_t::
174  {
175  this->colType_.set (x);
176  }
177 
178  void dBColumn_t::
180  {
181  this->colType_.set (x);
182  }
183 
184  void dBColumn_t::
186  {
187  this->colType_ = x;
188  }
189 
190  void dBColumn_t::
191  colType (::std::unique_ptr< colType_type > x)
192  {
193  this->colType_.set (std::move (x));
194  }
195 
197  value () const
198  {
199  return this->value_;
200  }
201 
204  {
205  return this->value_;
206  }
207 
209  getValue () const
210  {
211  return this->value_.get ();
212  }
213 
214  bool dBColumn_t::
215  hasValue () const
216  {
217  return this->value_.present ();
218  }
219 
220  void dBColumn_t::
222  {
223  this->value_.set (x);
224  }
225 
226  void dBColumn_t::
228  {
229  this->value_.set (x);
230  }
231 
232  void dBColumn_t::
234  {
235  this->value_ = x;
236  }
237 
238  void dBColumn_t::
239  value (::std::unique_ptr< value_type > x)
240  {
241  this->value_.set (std::move (x));
242  }
243 
245  null () const
246  {
247  return this->null_;
248  }
249 
252  {
253  return this->null_;
254  }
255 
257  getNull () const
258  {
259  return this->null_.get ();
260  }
261 
262  bool dBColumn_t::
263  hasNull () const
264  {
265  return this->null_.present ();
266  }
267 
268  void dBColumn_t::
269  null (const null_type& x)
270  {
271  this->null_.set (x);
272  }
273 
274  void dBColumn_t::
276  {
277  this->null_.set (x);
278  }
279 
280  void dBColumn_t::
282  {
283  this->null_ = x;
284  }
285 
287  fKeyTable () const
288  {
289  return this->fKeyTable_;
290  }
291 
294  {
295  return this->fKeyTable_;
296  }
297 
300  {
301  return this->fKeyTable_.get ();
302  }
303 
304  bool dBColumn_t::
306  {
307  return this->fKeyTable_.present ();
308  }
309 
310  void dBColumn_t::
312  {
313  this->fKeyTable_.set (x);
314  }
315 
316  void dBColumn_t::
318  {
319  this->fKeyTable_.set (x);
320  }
321 
322  void dBColumn_t::
324  {
325  this->fKeyTable_ = x;
326  }
327 
328  void dBColumn_t::
329  fKeyTable (::std::unique_ptr< fKeyTable_type > x)
330  {
331  this->fKeyTable_.set (std::move (x));
332  }
333 
335  fKeyColumn () const
336  {
337  return this->fKeyColumn_;
338  }
339 
342  {
343  return this->fKeyColumn_;
344  }
345 
348  {
349  return this->fKeyColumn_.get ();
350  }
351 
352  bool dBColumn_t::
354  {
355  return this->fKeyColumn_.present ();
356  }
357 
358  void dBColumn_t::
360  {
361  this->fKeyColumn_.set (x);
362  }
363 
364  void dBColumn_t::
366  {
367  this->fKeyColumn_.set (x);
368  }
369 
370  void dBColumn_t::
372  {
373  this->fKeyColumn_ = x;
374  }
375 
376  void dBColumn_t::
377  fKeyColumn (::std::unique_ptr< fKeyColumn_type > x)
378  {
379  this->fKeyColumn_.set (std::move (x));
380  }
381 
383  tolerance () const
384  {
385  return this->tolerance_;
386  }
387 
390  {
391  return this->tolerance_;
392  }
393 
396  {
397  return this->tolerance_.get ();
398  }
399 
400  bool dBColumn_t::
402  {
403  return this->tolerance_.present ();
404  }
405 
406  void dBColumn_t::
408  {
409  this->tolerance_.set (x);
410  }
411 
412  void dBColumn_t::
414  {
415  this->tolerance_.set (x);
416  }
417 
418  void dBColumn_t::
420  {
421  this->tolerance_ = x;
422  }
423 
424 
425  // dBCheck_t
426  //
427 
429  constraint () const
430  {
431  return this->constraint_.get ();
432  }
433 
436  {
437  return this->constraint_.get ();
438  }
439 
442  {
443  return this->constraint_.get ();
444  }
445 
446  bool dBCheck_t::
448  {
449  return this->constraint_.present ();
450  }
451 
452  void dBCheck_t::
454  {
455  this->constraint_.set (x);
456  }
457 
458  void dBCheck_t::
460  {
461  this->constraint_.set (x);
462  }
463 
464  void dBCheck_t::
465  constraint (::std::unique_ptr< constraint_type > x)
466  {
467  this->constraint_.set (std::move (x));
468  }
469 
470 
471  // dBRow_t
472  //
473 
475  dBCol () const
476  {
477  return this->dBCol_;
478  }
479 
482  {
483  return this->dBCol_;
484  }
485 
488  {
489  return this->dBCol_.size ();
490  }
491 
493  getDBCol (int index) const
494  {
495  return this->dBCol_[index];
496  }
497 
500  {
501  return this->dBCol_[index];
502  }
503 
504  bool dBRow_t::
505  hasDBCol () const
506  {
507  return ! (this->dBCol_.empty ());
508  }
509 
510  void dBRow_t::
512  {
513  this->dBCol_.clear ();
514  }
515 
516  void dBRow_t::
518  {
519  this->dBCol_ = s;
520  }
521 
522  void dBRow_t::
524  {
525  this->dBCol_.push_back (newDBCol);
526  }
527 
528 
529  // dBTable
530  //
531 
533  dBColumn () const
534  {
535  return this->dBColumn_;
536  }
537 
540  {
541  return this->dBColumn_;
542  }
543 
546  {
547  return this->dBColumn_.size ();
548  }
549 
551  getDBColumn (int index) const
552  {
553  return this->dBColumn_[index];
554  }
555 
558  {
559  return this->dBColumn_[index];
560  }
561 
562  bool dBTable::
563  hasDBColumn () const
564  {
565  return ! (this->dBColumn_.empty ());
566  }
567 
568  void dBTable::
570  {
571  this->dBColumn_.clear ();
572  }
573 
574  void dBTable::
576  {
577  this->dBColumn_ = s;
578  }
579 
580  void dBTable::
582  {
583  this->dBColumn_.push_back (newDBColumn);
584  }
585 
587  dBPKey () const
588  {
589  return this->dBPKey_;
590  }
591 
594  {
595  return this->dBPKey_;
596  }
597 
599  getDBPKey () const
600  {
601  return this->dBPKey_.get ();
602  }
603 
604  bool dBTable::
605  hasDBPKey () const
606  {
607  return this->dBPKey_.present ();
608  }
609 
610  void dBTable::
612  {
613  this->dBPKey_.set (x);
614  }
615 
616  void dBTable::
618  {
619  this->dBPKey_.set (x);
620  }
621 
622  void dBTable::
624  {
625  this->dBPKey_ = x;
626  }
627 
628  void dBTable::
629  dBPKey (::std::unique_ptr< dBPKey_type > x)
630  {
631  this->dBPKey_.set (std::move (x));
632  }
633 
635  dBUnique () const
636  {
637  return this->dBUnique_;
638  }
639 
642  {
643  return this->dBUnique_;
644  }
645 
648  {
649  return this->dBUnique_.size ();
650  }
651 
653  getDBUnique (int index) const
654  {
655  return this->dBUnique_[index];
656  }
657 
660  {
661  return this->dBUnique_[index];
662  }
663 
664  bool dBTable::
665  hasDBUnique () const
666  {
667  return ! (this->dBUnique_.empty ());
668  }
669 
670  void dBTable::
672  {
673  this->dBUnique_.clear ();
674  }
675 
676  void dBTable::
678  {
679  this->dBUnique_ = s;
680  }
681 
682  void dBTable::
684  {
685  this->dBUnique_.push_back (newDBUnique);
686  }
687 
689  dBCheck () const
690  {
691  return this->dBCheck_;
692  }
693 
696  {
697  return this->dBCheck_;
698  }
699 
702  {
703  return this->dBCheck_.size ();
704  }
705 
707  getDBCheck (int index) const
708  {
709  return this->dBCheck_[index];
710  }
711 
714  {
715  return this->dBCheck_[index];
716  }
717 
718  bool dBTable::
719  hasDBCheck () const
720  {
721  return ! (this->dBCheck_.empty ());
722  }
723 
724  void dBTable::
726  {
727  this->dBCheck_.clear ();
728  }
729 
730  void dBTable::
732  {
733  this->dBCheck_ = s;
734  }
735 
736  void dBTable::
738  {
739  this->dBCheck_.push_back (newDBCheck);
740  }
741 
743  dBRow () const
744  {
745  return this->dBRow_;
746  }
747 
750  {
751  return this->dBRow_;
752  }
753 
756  {
757  return this->dBRow_.size ();
758  }
759 
761  getDBRow (int index) const
762  {
763  return this->dBRow_[index];
764  }
765 
768  {
769  return this->dBRow_[index];
770  }
771 
772  bool dBTable::
773  hasDBRow () const
774  {
775  return ! (this->dBRow_.empty ());
776  }
777 
778  void dBTable::
780  {
781  this->dBRow_.clear ();
782  }
783 
784  void dBTable::
786  {
787  this->dBRow_ = s;
788  }
789 
790  void dBTable::
792  {
793  this->dBRow_.push_back (newDBRow);
794  }
795 
797  tableName () const
798  {
799  return this->tableName_.get ();
800  }
801 
804  {
805  return this->tableName_.get ();
806  }
807 
810  {
811  return this->tableName_.get ();
812  }
813 
814  bool dBTable::
816  {
817  return this->tableName_.present ();
818  }
819 
820  void dBTable::
822  {
823  this->tableName_.set (x);
824  }
825 
826  void dBTable::
828  {
829  this->tableName_.set (x);
830  }
831 
832  void dBTable::
833  tableName (::std::unique_ptr< tableName_type > x)
834  {
835  this->tableName_.set (std::move (x));
836  }
837 
839  dbHost () const
840  {
841  return this->dbHost_.get ();
842  }
843 
846  {
847  return this->dbHost_.get ();
848  }
849 
851  getDbHost () const
852  {
853  return this->dbHost_.get ();
854  }
855 
856  bool dBTable::
857  hasDbHost () const
858  {
859  return this->dbHost_.present ();
860  }
861 
862  void dBTable::
864  {
865  this->dbHost_.set (x);
866  }
867 
868  void dBTable::
870  {
871  this->dbHost_.set (x);
872  }
873 
874  void dBTable::
875  dbHost (::std::unique_ptr< dbHost_type > x)
876  {
877  this->dbHost_.set (std::move (x));
878  }
879 
881  dbName () const
882  {
883  return this->dbName_.get ();
884  }
885 
888  {
889  return this->dbName_.get ();
890  }
891 
893  getDbName () const
894  {
895  return this->dbName_.get ();
896  }
897 
898  bool dBTable::
899  hasDbName () const
900  {
901  return this->dbName_.present ();
902  }
903 
904  void dBTable::
906  {
907  this->dbName_.set (x);
908  }
909 
910  void dBTable::
912  {
913  this->dbName_.set (x);
914  }
915 
916  void dBTable::
917  dbName (::std::unique_ptr< dbName_type > x)
918  {
919  this->dbName_.set (std::move (x));
920  }
921 
923  dbType () const
924  {
925  return this->dbType_;
926  }
927 
930  {
931  return this->dbType_;
932  }
933 
935  getDbType () const
936  {
937  return this->dbType_.get ();
938  }
939 
940  bool dBTable::
941  hasDbType () const
942  {
943  return this->dbType_.present ();
944  }
945 
946  void dBTable::
948  {
949  this->dbType_.set (x);
950  }
951 
952  void dBTable::
954  {
955  this->dbType_.set (x);
956  }
957 
958  void dBTable::
960  {
961  this->dbType_ = x;
962  }
963 
964  void dBTable::
965  dbType (::std::unique_ptr< dbType_type > x)
966  {
967  this->dbType_.set (std::move (x));
968  }
969 
971  dbPort () const
972  {
973  return this->dbPort_;
974  }
975 
978  {
979  return this->dbPort_;
980  }
981 
983  getDbPort () const
984  {
985  return this->dbPort_.get ();
986  }
987 
988  bool dBTable::
989  hasDbPort () const
990  {
991  return this->dbPort_.present ();
992  }
993 
994  void dBTable::
996  {
997  this->dbPort_.set (x);
998  }
999 
1000  void dBTable::
1002  {
1003  this->dbPort_.set (x);
1004  }
1005 
1006  void dBTable::
1008  {
1009  this->dbPort_ = x;
1010  }
1011 
1012  void dBTable::
1013  dbPort (::std::unique_ptr< dbPort_type > x)
1014  {
1015  this->dbPort_.set (std::move (x));
1016  }
1017 
1019  tableType () const
1020  {
1021  return this->tableType_;
1022  }
1023 
1026  {
1027  return this->tableType_;
1028  }
1029 
1032  {
1033  return this->tableType_.get ();
1034  }
1035 
1036  bool dBTable::
1038  {
1039  return this->tableType_.present ();
1040  }
1041 
1042  void dBTable::
1044  {
1045  this->tableType_.set (x);
1046  }
1047 
1048  void dBTable::
1050  {
1051  this->tableType_.set (x);
1052  }
1053 
1054  void dBTable::
1056  {
1057  this->tableType_ = x;
1058  }
1059 
1060  void dBTable::
1061  tableType (::std::unique_ptr< tableType_type > x)
1062  {
1063  this->tableType_.set (std::move (x));
1064  }
1065 
1068  {
1069  return this->creationDate_;
1070  }
1071 
1074  {
1075  return this->creationDate_;
1076  }
1077 
1080  {
1081  return this->creationDate_.get ();
1082  }
1083 
1084  bool dBTable::
1086  {
1087  return this->creationDate_.present ();
1088  }
1089 
1090  void dBTable::
1092  {
1093  this->creationDate_.set (x);
1094  }
1095 
1096  void dBTable::
1098  {
1099  this->creationDate_.set (x);
1100  }
1101 
1102  void dBTable::
1104  {
1105  this->creationDate_ = x;
1106  }
1107 
1108  void dBTable::
1109  creationDate (::std::unique_ptr< creationDate_type > x)
1110  {
1111  this->creationDate_.set (std::move (x));
1112  }
1113 
1115  maintainer () const
1116  {
1117  return this->maintainer_;
1118  }
1119 
1122  {
1123  return this->maintainer_;
1124  }
1125 
1128  {
1129  return this->maintainer_.get ();
1130  }
1131 
1132  bool dBTable::
1134  {
1135  return this->maintainer_.present ();
1136  }
1137 
1138  void dBTable::
1140  {
1141  this->maintainer_.set (x);
1142  }
1143 
1144  void dBTable::
1146  {
1147  this->maintainer_.set (x);
1148  }
1149 
1150  void dBTable::
1152  {
1153  this->maintainer_ = x;
1154  }
1155 
1156  void dBTable::
1157  maintainer (::std::unique_ptr< maintainer_type > x)
1158  {
1159  this->maintainer_.set (std::move (x));
1160  }
1161 
1163  xmlOverDB () const
1164  {
1165  return this->xmlOverDB_;
1166  }
1167 
1170  {
1171  return this->xmlOverDB_;
1172  }
1173 
1176  {
1177  return this->xmlOverDB_.get ();
1178  }
1179 
1180  bool dBTable::
1182  {
1183  return this->xmlOverDB_.present ();
1184  }
1185 
1186  void dBTable::
1188  {
1189  this->xmlOverDB_.set (x);
1190  }
1191 
1192  void dBTable::
1194  {
1195  this->xmlOverDB_.set (x);
1196  }
1197 
1198  void dBTable::
1200  {
1201  this->xmlOverDB_ = x;
1202  }
1203 
1205  ignoreDB () const
1206  {
1207  return this->ignoreDB_;
1208  }
1209 
1212  {
1213  return this->ignoreDB_;
1214  }
1215 
1218  {
1219  return this->ignoreDB_.get ();
1220  }
1221 
1222  bool dBTable::
1224  {
1225  return this->ignoreDB_.present ();
1226  }
1227 
1228  void dBTable::
1230  {
1231  this->ignoreDB_.set (x);
1232  }
1233 
1234  void dBTable::
1236  {
1237  this->ignoreDB_.set (x);
1238  }
1239 
1240  void dBTable::
1242  {
1243  this->ignoreDB_ = x;
1244  }
1245 
1248  {
1249  return this->addInsertTime_;
1250  }
1251 
1254  {
1255  return this->addInsertTime_;
1256  }
1257 
1260  {
1261  return this->addInsertTime_.get ();
1262  }
1263 
1264  bool dBTable::
1266  {
1267  return this->addInsertTime_.present ();
1268  }
1269 
1270  void dBTable::
1272  {
1273  this->addInsertTime_.set (x);
1274  }
1275 
1276  void dBTable::
1278  {
1279  this->addInsertTime_.set (x);
1280  }
1281 
1282  void dBTable::
1284  {
1285  this->addInsertTime_ = x;
1286  }
1287 
1290  {
1291  return this->addInsertUser_;
1292  }
1293 
1296  {
1297  return this->addInsertUser_;
1298  }
1299 
1302  {
1303  return this->addInsertUser_.get ();
1304  }
1305 
1306  bool dBTable::
1308  {
1309  return this->addInsertUser_.present ();
1310  }
1311 
1312  void dBTable::
1314  {
1315  this->addInsertUser_.set (x);
1316  }
1317 
1318  void dBTable::
1320  {
1321  this->addInsertUser_.set (x);
1322  }
1323 
1324  void dBTable::
1326  {
1327  this->addInsertUser_ = x;
1328  }
1329 
1332  {
1333  return this->addUpdateTime_;
1334  }
1335 
1338  {
1339  return this->addUpdateTime_;
1340  }
1341 
1344  {
1345  return this->addUpdateTime_.get ();
1346  }
1347 
1348  bool dBTable::
1350  {
1351  return this->addUpdateTime_.present ();
1352  }
1353 
1354  void dBTable::
1356  {
1357  this->addUpdateTime_.set (x);
1358  }
1359 
1360  void dBTable::
1362  {
1363  this->addUpdateTime_.set (x);
1364  }
1365 
1366  void dBTable::
1368  {
1369  this->addUpdateTime_ = x;
1370  }
1371 
1374  {
1375  return this->addUpdateUser_;
1376  }
1377 
1380  {
1381  return this->addUpdateUser_;
1382  }
1383 
1386  {
1387  return this->addUpdateUser_.get ();
1388  }
1389 
1390  bool dBTable::
1392  {
1393  return this->addUpdateUser_.present ();
1394  }
1395 
1396  void dBTable::
1398  {
1399  this->addUpdateUser_.set (x);
1400  }
1401 
1402  void dBTable::
1404  {
1405  this->addUpdateUser_.set (x);
1406  }
1407 
1408  void dBTable::
1410  {
1411  this->addUpdateUser_ = x;
1412  }
1413 
1415  schema () const
1416  {
1417  return this->schema_;
1418  }
1419 
1422  {
1423  return this->schema_;
1424  }
1425 
1427  getSchema () const
1428  {
1429  return this->schema_.get ();
1430  }
1431 
1432  bool dBTable::
1433  hasSchema () const
1434  {
1435  return this->schema_.present ();
1436  }
1437 
1438  void dBTable::
1440  {
1441  this->schema_.set (x);
1442  }
1443 
1444  void dBTable::
1446  {
1447  this->schema_.set (x);
1448  }
1449 
1450  void dBTable::
1452  {
1453  this->schema_ = x;
1454  }
1455 
1456  void dBTable::
1457  schema (::std::unique_ptr< schema_type > x)
1458  {
1459  this->schema_.set (std::move (x));
1460  }
1461  }
1462 }
1463 
1464 #include <xsd/cxx/xml/dom/parsing-source.hxx>
1465 #include <xsd/cxx/xml/sax/std-input-source.hxx>
1466 #include <xsd/cxx/tree/error-handler.hxx>
1467 
1468 namespace nova
1469 {
1470  namespace dbi
1471  {
1472  // dBColumn_t
1473  //
1474 
1475  dBColumn_t::
1477  : ::xml_schema::type (),
1478  name_ (this),
1479  colType_ (this),
1480  value_ (this),
1481  null_ (this),
1482  fKeyTable_ (this),
1483  fKeyColumn_ (this),
1484  tolerance_ (this)
1485  {
1486  }
1487 
1488  dBColumn_t::
1490  : ::xml_schema::type (),
1491  name_ (name, this),
1492  colType_ (this),
1493  value_ (this),
1494  null_ (this),
1495  fKeyTable_ (this),
1496  fKeyColumn_ (this),
1497  tolerance_ (this)
1498  {
1499  }
1500 
1501  dBColumn_t::
1503  ::xml_schema::flags f,
1505  : ::xml_schema::type (x, f, c),
1506  name_ (x.name_, f, this),
1507  colType_ (x.colType_, f, this),
1508  value_ (x.value_, f, this),
1509  null_ (x.null_, f, this),
1510  fKeyTable_ (x.fKeyTable_, f, this),
1511  fKeyColumn_ (x.fKeyColumn_, f, this),
1512  tolerance_ (x.tolerance_, f, this)
1513  {
1514  }
1515 
1516  dBColumn_t::
1517  dBColumn_t (const ::xercesc::DOMElement& e,
1518  ::xml_schema::flags f,
1520  : ::xml_schema::type (e, f | ::xml_schema::flags::base, c),
1521  name_ (this),
1522  colType_ (this),
1523  value_ (this),
1524  null_ (this),
1525  fKeyTable_ (this),
1526  fKeyColumn_ (this),
1527  tolerance_ (this)
1528  {
1529  if ((f & ::xml_schema::flags::base) == 0)
1530  {
1531  ::xsd::cxx::xml::dom::parser< char > p (e, false, false, true);
1532  this->parse (p, f);
1533  }
1534  }
1535 
1536  void dBColumn_t::
1537  parse (::xsd::cxx::xml::dom::parser< char >& p,
1538  ::xml_schema::flags f)
1539  {
1540  while (p.more_attributes ())
1541  {
1542  const ::xercesc::DOMAttr& i (p.next_attribute ());
1543  const ::xsd::cxx::xml::qualified_name< char > n (
1544  ::xsd::cxx::xml::dom::name< char > (i));
1545 
1546  if (n.name () == "name" && n.namespace_ ().empty ())
1547  {
1548  this->name_.set (name_traits::create (i, f, this));
1549  continue;
1550  }
1551 
1552  if (n.name () == "colType" && n.namespace_ ().empty ())
1553  {
1554  this->colType_.set (colType_traits::create (i, f, this));
1555  continue;
1556  }
1557 
1558  if (n.name () == "value" && n.namespace_ ().empty ())
1559  {
1560  this->value_.set (value_traits::create (i, f, this));
1561  continue;
1562  }
1563 
1564  if (n.name () == "null" && n.namespace_ ().empty ())
1565  {
1566  this->null_.set (null_traits::create (i, f, this));
1567  continue;
1568  }
1569 
1570  if (n.name () == "fKeyTable" && n.namespace_ ().empty ())
1571  {
1572  this->fKeyTable_.set (fKeyTable_traits::create (i, f, this));
1573  continue;
1574  }
1575 
1576  if (n.name () == "fKeyColumn" && n.namespace_ ().empty ())
1577  {
1578  this->fKeyColumn_.set (fKeyColumn_traits::create (i, f, this));
1579  continue;
1580  }
1581 
1582  if (n.name () == "tolerance" && n.namespace_ ().empty ())
1583  {
1584  this->tolerance_.set (tolerance_traits::create (i, f, this));
1585  continue;
1586  }
1587  }
1588 
1589  if (!name_.present ())
1590  {
1592  {
1593  std::cerr << "ERROR: expected attribute (dBColumn_t::name) not found!" << std::endl;
1594  throw ::xsd::cxx::tree::expected_attribute< char > (
1595  "name",
1596  "");
1597  }
1598  }
1599  }
1600 
1603  ::xml_schema::container* c) const
1604  {
1605  return new class dBColumn_t (*this, f, c);
1606  }
1607 
1610  {
1611  if (this != &x)
1612  {
1613  static_cast< ::xml_schema::type& > (*this) = x;
1614  this->name_ = x.name_;
1615  this->colType_ = x.colType_;
1616  this->value_ = x.value_;
1617  this->null_ = x.null_;
1618  this->fKeyTable_ = x.fKeyTable_;
1619  this->fKeyColumn_ = x.fKeyColumn_;
1620  this->tolerance_ = x.tolerance_;
1621  }
1622 
1623  return *this;
1624  }
1625 
1626  dBColumn_t::
1628  {
1629  }
1630 
1631  void dBColumn_t::
1633  {
1634  if (x.hasName()) {
1635  if (! this->hasName()) {
1636  this->setName(x.getName());
1637  }
1638  else {
1640  }
1641  }
1642  }
1643 
1644  // dBCheck_t
1645  //
1646 
1647  dBCheck_t::
1649  : ::xml_schema::type (),
1650  constraint_ (this)
1651  {
1652  }
1653 
1654  dBCheck_t::
1656  : ::xml_schema::type (),
1657  constraint_ (constraint, this)
1658  {
1659  }
1660 
1661  dBCheck_t::
1663  ::xml_schema::flags f,
1665  : ::xml_schema::type (x, f, c),
1666  constraint_ (x.constraint_, f, this)
1667  {
1668  }
1669 
1670  dBCheck_t::
1671  dBCheck_t (const ::xercesc::DOMElement& e,
1672  ::xml_schema::flags f,
1674  : ::xml_schema::type (e, f | ::xml_schema::flags::base, c),
1675  constraint_ (this)
1676  {
1677  if ((f & ::xml_schema::flags::base) == 0)
1678  {
1679  ::xsd::cxx::xml::dom::parser< char > p (e, false, false, true);
1680  this->parse (p, f);
1681  }
1682  }
1683 
1684  void dBCheck_t::
1685  parse (::xsd::cxx::xml::dom::parser< char >& p,
1686  ::xml_schema::flags f)
1687  {
1688  while (p.more_attributes ())
1689  {
1690  const ::xercesc::DOMAttr& i (p.next_attribute ());
1691  const ::xsd::cxx::xml::qualified_name< char > n (
1692  ::xsd::cxx::xml::dom::name< char > (i));
1693 
1694  if (n.name () == "constraint" && n.namespace_ ().empty ())
1695  {
1696  this->constraint_.set (constraint_traits::create (i, f, this));
1697  continue;
1698  }
1699  }
1700 
1701  if (!constraint_.present ())
1702  {
1704  {
1705  std::cerr << "ERROR: expected attribute (dBCheck_t::constraint) not found!" << std::endl;
1706  throw ::xsd::cxx::tree::expected_attribute< char > (
1707  "constraint",
1708  "");
1709  }
1710  }
1711  }
1712 
1715  ::xml_schema::container* c) const
1716  {
1717  return new class dBCheck_t (*this, f, c);
1718  }
1719 
1722  {
1723  if (this != &x)
1724  {
1725  static_cast< ::xml_schema::type& > (*this) = x;
1726  this->constraint_ = x.constraint_;
1727  }
1728 
1729  return *this;
1730  }
1731 
1732  dBCheck_t::
1734  {
1735  }
1736 
1737  void dBCheck_t::
1739  {
1740  if (x.hasConstraint()) {
1741  if (! this->hasConstraint()) {
1742  this->setConstraint(x.getConstraint());
1743  }
1744  else {
1746  }
1747  }
1748  }
1749 
1750  // dBRow_t
1751  //
1752 
1753  dBRow_t::
1755  : ::xml_schema::type (),
1756  dBCol_ (this)
1757  {
1758  }
1759 
1760  dBRow_t::
1762  ::xml_schema::flags f,
1764  : ::xml_schema::type (x, f, c),
1765  dBCol_ (x.dBCol_, f, this)
1766  {
1767  }
1768 
1769  dBRow_t::
1770  dBRow_t (const ::xercesc::DOMElement& e,
1771  ::xml_schema::flags f,
1773  : ::xml_schema::type (e, f | ::xml_schema::flags::base, c),
1774  dBCol_ (this)
1775  {
1776  if ((f & ::xml_schema::flags::base) == 0)
1777  {
1778  ::xsd::cxx::xml::dom::parser< char > p (e, true, false, false);
1779  this->parse (p, f);
1780  }
1781  }
1782 
1783  void dBRow_t::
1784  parse (::xsd::cxx::xml::dom::parser< char >& p,
1785  ::xml_schema::flags f)
1786  {
1787  for (; p.more_content (); p.next_content (false))
1788  {
1789  const ::xercesc::DOMElement& i (p.cur_element ());
1790  const ::xsd::cxx::xml::qualified_name< char > n (
1791  ::xsd::cxx::xml::dom::name< char > (i));
1792 
1793  // dBCol
1794  //
1795  if (n.name () == "dBCol" && n.namespace_ ().empty ())
1796  {
1797  ::std::unique_ptr< dBCol_type > r (
1798  dBCol_traits::create (i, f, this));
1799 
1800  this->dBCol_.push_back (::std::move (r));
1801  continue;
1802  }
1803 
1804  break;
1805  }
1806  }
1807 
1810  ::xml_schema::container* c) const
1811  {
1812  return new class dBRow_t (*this, f, c);
1813  }
1814 
1817  {
1818  if (this != &x)
1819  {
1820  static_cast< ::xml_schema::type& > (*this) = x;
1821  this->dBCol_ = x.dBCol_;
1822  }
1823 
1824  return *this;
1825  }
1826 
1827  dBRow_t::
1829  {
1830  }
1831 
1832  void dBRow_t::
1834  {
1835  if (x.hasDBCol() && x.getDBColCount() > 0) {
1836  if (! this->hasDBCol() || this->getDBColCount() == 0) {
1837  for (::xml_schema::integer idx = 0; idx < x.getDBColCount(); ++idx) {
1838  this->addDBCol(x.getDBCol(idx));
1839  }
1840  }
1841  //else {
1842  // copyTraits<dBCol_type>::copyNeededFields(x.getDBCol(), this->dBCol());
1843  //}
1844  }
1845  }
1846 
1847  // dBTable
1848  //
1849 
1850  dBTable::
1852  : ::xml_schema::type (),
1853  dBColumn_ (this),
1854  dBPKey_ (this),
1855  dBUnique_ (this),
1856  dBCheck_ (this),
1857  dBRow_ (this),
1858  tableName_ (this),
1859  dbHost_ (this),
1860  dbName_ (this),
1861  dbType_ (this),
1862  dbPort_ (this),
1863  tableType_ (this),
1864  creationDate_ (this),
1865  maintainer_ (this),
1866  xmlOverDB_ (this),
1867  ignoreDB_ (this),
1868  addInsertTime_ (this),
1869  addInsertUser_ (this),
1870  addUpdateTime_ (this),
1871  addUpdateUser_ (this),
1872  schema_ (this)
1873  {
1874  }
1875 
1876  dBTable::
1878  const dbHost_type& dbHost,
1879  const dbName_type& dbName)
1880  : ::xml_schema::type (),
1881  dBColumn_ (this),
1882  dBPKey_ (this),
1883  dBUnique_ (this),
1884  dBCheck_ (this),
1885  dBRow_ (this),
1886  tableName_ (tableName, this),
1887  dbHost_ (dbHost, this),
1888  dbName_ (dbName, this),
1889  dbType_ (this),
1890  dbPort_ (this),
1891  tableType_ (this),
1892  creationDate_ (this),
1893  maintainer_ (this),
1894  xmlOverDB_ (this),
1895  ignoreDB_ (this),
1896  addInsertTime_ (this),
1897  addInsertUser_ (this),
1898  addUpdateTime_ (this),
1899  addUpdateUser_ (this),
1900  schema_ (this)
1901  {
1902  }
1903 
1904  dBTable::
1906  ::xml_schema::flags f,
1908  : ::xml_schema::type (x, f, c),
1909  dBColumn_ (x.dBColumn_, f, this),
1910  dBPKey_ (x.dBPKey_, f, this),
1911  dBUnique_ (x.dBUnique_, f, this),
1912  dBCheck_ (x.dBCheck_, f, this),
1913  dBRow_ (x.dBRow_, f, this),
1914  tableName_ (x.tableName_, f, this),
1915  dbHost_ (x.dbHost_, f, this),
1916  dbName_ (x.dbName_, f, this),
1917  dbType_ (x.dbType_, f, this),
1918  dbPort_ (x.dbPort_, f, this),
1919  tableType_ (x.tableType_, f, this),
1920  creationDate_ (x.creationDate_, f, this),
1921  maintainer_ (x.maintainer_, f, this),
1922  xmlOverDB_ (x.xmlOverDB_, f, this),
1923  ignoreDB_ (x.ignoreDB_, f, this),
1924  addInsertTime_ (x.addInsertTime_, f, this),
1925  addInsertUser_ (x.addInsertUser_, f, this),
1926  addUpdateTime_ (x.addUpdateTime_, f, this),
1927  addUpdateUser_ (x.addUpdateUser_, f, this),
1928  schema_ (x.schema_, f, this)
1929  {
1930  }
1931 
1932  dBTable::
1933  dBTable (const ::xercesc::DOMElement& e,
1934  ::xml_schema::flags f,
1936  : ::xml_schema::type (e, f | ::xml_schema::flags::base, c),
1937  dBColumn_ (this),
1938  dBPKey_ (this),
1939  dBUnique_ (this),
1940  dBCheck_ (this),
1941  dBRow_ (this),
1942  tableName_ (this),
1943  dbHost_ (this),
1944  dbName_ (this),
1945  dbType_ (this),
1946  dbPort_ (this),
1947  tableType_ (this),
1948  creationDate_ (this),
1949  maintainer_ (this),
1950  xmlOverDB_ (this),
1951  ignoreDB_ (this),
1952  addInsertTime_ (this),
1953  addInsertUser_ (this),
1954  addUpdateTime_ (this),
1955  addUpdateUser_ (this),
1956  schema_ (this)
1957  {
1958  if ((f & ::xml_schema::flags::base) == 0)
1959  {
1960  ::xsd::cxx::xml::dom::parser< char > p (e, true, false, true);
1961  this->parse (p, f);
1962  }
1963  }
1964 
1965  void dBTable::
1966  parse (::xsd::cxx::xml::dom::parser< char >& p,
1967  ::xml_schema::flags f)
1968  {
1969  for (; p.more_content (); p.next_content (false))
1970  {
1971  const ::xercesc::DOMElement& i (p.cur_element ());
1972  const ::xsd::cxx::xml::qualified_name< char > n (
1973  ::xsd::cxx::xml::dom::name< char > (i));
1974 
1975  // dBColumn
1976  //
1977  if (n.name () == "dBColumn" && n.namespace_ ().empty ())
1978  {
1979  ::std::unique_ptr< dBColumn_type > r (
1980  dBColumn_traits::create (i, f, this));
1981 
1982  this->dBColumn_.push_back (::std::move (r));
1983  continue;
1984  }
1985 
1986  // dBPKey
1987  //
1988  if (n.name () == "dBPKey" && n.namespace_ ().empty ())
1989  {
1990  ::std::unique_ptr< dBPKey_type > r (
1991  dBPKey_traits::create (i, f, this));
1992 
1993  if (!this->dBPKey_)
1994  {
1995  this->dBPKey_.set (::std::move (r));
1996  continue;
1997  }
1998  }
1999 
2000  // dBUnique
2001  //
2002  if (n.name () == "dBUnique" && n.namespace_ ().empty ())
2003  {
2004  ::std::unique_ptr< dBUnique_type > r (
2005  dBUnique_traits::create (i, f, this));
2006 
2007  this->dBUnique_.push_back (::std::move (r));
2008  continue;
2009  }
2010 
2011  // dBCheck
2012  //
2013  if (n.name () == "dBCheck" && n.namespace_ ().empty ())
2014  {
2015  ::std::unique_ptr< dBCheck_type > r (
2016  dBCheck_traits::create (i, f, this));
2017 
2018  this->dBCheck_.push_back (::std::move (r));
2019  continue;
2020  }
2021 
2022  // dBRow
2023  //
2024  if (n.name () == "dBRow" && n.namespace_ ().empty ())
2025  {
2026  ::std::unique_ptr< dBRow_type > r (
2027  dBRow_traits::create (i, f, this));
2028 
2029  this->dBRow_.push_back (::std::move (r));
2030  continue;
2031  }
2032 
2033  break;
2034  }
2035 
2036  while (p.more_attributes ())
2037  {
2038  const ::xercesc::DOMAttr& i (p.next_attribute ());
2039  const ::xsd::cxx::xml::qualified_name< char > n (
2040  ::xsd::cxx::xml::dom::name< char > (i));
2041 
2042  if (n.name () == "tableName" && n.namespace_ ().empty ())
2043  {
2044  this->tableName_.set (tableName_traits::create (i, f, this));
2045  continue;
2046  }
2047 
2048  if (n.name () == "dbHost" && n.namespace_ ().empty ())
2049  {
2050  this->dbHost_.set (dbHost_traits::create (i, f, this));
2051  continue;
2052  }
2053 
2054  if (n.name () == "dbName" && n.namespace_ ().empty ())
2055  {
2056  this->dbName_.set (dbName_traits::create (i, f, this));
2057  continue;
2058  }
2059 
2060  if (n.name () == "dbType" && n.namespace_ ().empty ())
2061  {
2062  this->dbType_.set (dbType_traits::create (i, f, this));
2063  continue;
2064  }
2065 
2066  if (n.name () == "dbPort" && n.namespace_ ().empty ())
2067  {
2068  this->dbPort_.set (dbPort_traits::create (i, f, this));
2069  continue;
2070  }
2071 
2072  if (n.name () == "tableType" && n.namespace_ ().empty ())
2073  {
2074  this->tableType_.set (tableType_traits::create (i, f, this));
2075  continue;
2076  }
2077 
2078  if (n.name () == "creationDate" && n.namespace_ ().empty ())
2079  {
2080  this->creationDate_.set (creationDate_traits::create (i, f, this));
2081  continue;
2082  }
2083 
2084  if (n.name () == "maintainer" && n.namespace_ ().empty ())
2085  {
2086  this->maintainer_.set (maintainer_traits::create (i, f, this));
2087  continue;
2088  }
2089 
2090  if (n.name () == "xmlOverDB" && n.namespace_ ().empty ())
2091  {
2092  this->xmlOverDB_.set (xmlOverDB_traits::create (i, f, this));
2093  continue;
2094  }
2095 
2096  if (n.name () == "ignoreDB" && n.namespace_ ().empty ())
2097  {
2098  this->ignoreDB_.set (ignoreDB_traits::create (i, f, this));
2099  continue;
2100  }
2101 
2102  if (n.name () == "addInsertTime" && n.namespace_ ().empty ())
2103  {
2104  this->addInsertTime_.set (addInsertTime_traits::create (i, f, this));
2105  continue;
2106  }
2107 
2108  if (n.name () == "addInsertUser" && n.namespace_ ().empty ())
2109  {
2110  this->addInsertUser_.set (addInsertUser_traits::create (i, f, this));
2111  continue;
2112  }
2113 
2114  if (n.name () == "addUpdateTime" && n.namespace_ ().empty ())
2115  {
2116  this->addUpdateTime_.set (addUpdateTime_traits::create (i, f, this));
2117  continue;
2118  }
2119 
2120  if (n.name () == "addUpdateUser" && n.namespace_ ().empty ())
2121  {
2122  this->addUpdateUser_.set (addUpdateUser_traits::create (i, f, this));
2123  continue;
2124  }
2125 
2126  if (n.name () == "schema" && n.namespace_ ().empty ())
2127  {
2128  this->schema_.set (schema_traits::create (i, f, this));
2129  continue;
2130  }
2131  }
2132 
2133  if (!tableName_.present ())
2134  {
2136  {
2137  std::cerr << "ERROR: expected attribute (dBTable::tableName) not found!" << std::endl;
2138  throw ::xsd::cxx::tree::expected_attribute< char > (
2139  "tableName",
2140  "");
2141  }
2142  }
2143 
2144  if (!dbHost_.present ())
2145  {
2147  {
2148  std::cerr << "ERROR: expected attribute (dBTable::dbHost) not found!" << std::endl;
2149  throw ::xsd::cxx::tree::expected_attribute< char > (
2150  "dbHost",
2151  "");
2152  }
2153  }
2154 
2155  if (!dbName_.present ())
2156  {
2158  {
2159  std::cerr << "ERROR: expected attribute (dBTable::dbName) not found!" << std::endl;
2160  throw ::xsd::cxx::tree::expected_attribute< char > (
2161  "dbName",
2162  "");
2163  }
2164  }
2165  }
2166 
2169  ::xml_schema::container* c) const
2170  {
2171  return new class dBTable (*this, f, c);
2172  }
2173 
2176  {
2177  if (this != &x)
2178  {
2179  static_cast< ::xml_schema::type& > (*this) = x;
2180  this->dBColumn_ = x.dBColumn_;
2181  this->dBPKey_ = x.dBPKey_;
2182  this->dBUnique_ = x.dBUnique_;
2183  this->dBCheck_ = x.dBCheck_;
2184  this->dBRow_ = x.dBRow_;
2185  this->tableName_ = x.tableName_;
2186  this->dbHost_ = x.dbHost_;
2187  this->dbName_ = x.dbName_;
2188  this->dbType_ = x.dbType_;
2189  this->dbPort_ = x.dbPort_;
2190  this->tableType_ = x.tableType_;
2191  this->creationDate_ = x.creationDate_;
2192  this->maintainer_ = x.maintainer_;
2193  this->xmlOverDB_ = x.xmlOverDB_;
2194  this->ignoreDB_ = x.ignoreDB_;
2195  this->addInsertTime_ = x.addInsertTime_;
2196  this->addInsertUser_ = x.addInsertUser_;
2197  this->addUpdateTime_ = x.addUpdateTime_;
2198  this->addUpdateUser_ = x.addUpdateUser_;
2199  this->schema_ = x.schema_;
2200  }
2201 
2202  return *this;
2203  }
2204 
2205  dBTable::
2207  {
2208  }
2209 
2211  serialize () const
2212  {
2213  // To avoid problems with multi-threaded access to
2214  // CST XSD ser/deserialization code and underlying
2215  // Xerces-C++ code, we prevent concurrent access
2216  // to any serialization code by any class that
2217  // inherits from XMLSerializable via the use of a
2218  // static mutex in XMLSerializable.
2219  boost::mutex::scoped_lock lock(_serializationMutex);
2220 
2221  ::std::ostringstream oss;
2222  dBTable_ (oss, *this);
2223  return oss.str();
2224  }
2225 
2226  void dBTable::
2228  {
2229  // To avoid problems with multi-threaded access to
2230  // CST XSD ser/deserialization code and underlying
2231  // Xerces-C++ code, we prevent concurrent access
2232  // to any deserialization code by any class that
2233  // inherits from XMLSerializable via the use of a
2234  // static mutex in XMLSerializable.
2235  boost::mutex::scoped_lock lock(_serializationMutex);
2236 
2237  // initialization for XSD
2238  ::xml_schema::flags flags = ::xml_schema::flags::dont_validate;
2239  ::xsd::cxx::xml::auto_initializer autoInit
2240  ((flags & ::xml_schema::flags::dont_initialize) == 0,
2241  (flags & ::xml_schema::flags::keep_dom) == 0);
2242  ::xsd::cxx::tree::error_handler< char > errorHandler;
2244 
2245  // wrap the string in an input stream
2246  ::std::istringstream iss (serializedData);
2247  ::xsd::cxx::xml::sax::std_input_source isrc (iss);
2248 
2249  // create a DOM from the input stream
2250  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument > doc (
2251  ::xsd::cxx::xml::dom::parse< char > (isrc, errorHandler, props, flags));
2252  errorHandler.throw_if_failed< ::xsd::cxx::tree::parsing< char > > ();
2253 
2254  // do the deserialization
2255  ::xsd::cxx::xml::dom::parser< char > parser (*(doc->getDocumentElement()), true, false, true);
2256  this->parse (parser, flags);
2257  }
2258 
2261  {
2262  return "nova::dbi::dBTable";
2263  }
2264 
2265  ::boost::shared_ptr< ::novadaq::XMLSerializable > dBTable::
2266  clone () const
2267  {
2268  dBTable *copy = this->_clone ();
2269  boost::shared_ptr<novadaq::XMLSerializable> copyPtr (copy);
2270  return copyPtr;
2271  }
2272 
2273  void dBTable::
2275  {
2276  boost::shared_ptr<novadaq::XMLSerializable> msgPtr;
2279  msgPtr.reset(new dBTable());
2280  deserRegistry.registerClass(msgPtr->getClassName(), msgPtr);
2281  }
2282 
2283  void dBTable::
2285  {
2286  if (x.hasDBPKey()) {
2287  if (! this->hasDBPKey()) {
2288  this->setDBPKey(x.getDBPKey());
2289  }
2290  else {
2292  }
2293  }
2294  if (x.hasDbHost()) {
2295  if (! this->hasDbHost()) {
2296  this->setDbHost(x.getDbHost());
2297  }
2298  else {
2300  }
2301  }
2302  if (x.hasDbName()) {
2303  if (! this->hasDbName()) {
2304  this->setDbName(x.getDbName());
2305  }
2306  else {
2308  }
2309  }
2310  if (x.hasTableName()) {
2311  if (! this->hasTableName()) {
2312  this->setTableName(x.getTableName());
2313  }
2314  else {
2316  }
2317  }
2318  if (x.hasDBCheck() && x.getDBCheckCount() > 0) {
2319  if (! this->hasDBCheck() || this->getDBCheckCount() == 0) {
2320  for (::xml_schema::integer idx = 0; idx < x.getDBCheckCount(); ++idx) {
2321  this->addDBCheck(x.getDBCheck(idx));
2322  }
2323  }
2324  //else {
2325  // copyTraits<dBCheck_type>::copyNeededFields(x.getDBCheck(), this->dBCheck());
2326  //}
2327  }
2328  if (x.hasDBColumn() && x.getDBColumnCount() > 0) {
2329  if (! this->hasDBColumn() || this->getDBColumnCount() == 0) {
2330  for (::xml_schema::integer idx = 0; idx < x.getDBColumnCount(); ++idx) {
2331  this->addDBColumn(x.getDBColumn(idx));
2332  }
2333  }
2334  //else {
2335  // copyTraits<dBColumn_type>::copyNeededFields(x.getDBColumn(), this->dBColumn());
2336  //}
2337  }
2338  if (x.hasDBRow() && x.getDBRowCount() > 0) {
2339  if (! this->hasDBRow() || this->getDBRowCount() == 0) {
2340  for (::xml_schema::integer idx = 0; idx < x.getDBRowCount(); ++idx) {
2341  this->addDBRow(x.getDBRow(idx));
2342  }
2343  }
2344  //else {
2345  // copyTraits<dBRow_type>::copyNeededFields(x.getDBRow(), this->dBRow());
2346  //}
2347  }
2348  if (x.hasDBUnique() && x.getDBUniqueCount() > 0) {
2349  if (! this->hasDBUnique() || this->getDBUniqueCount() == 0) {
2350  for (::xml_schema::integer idx = 0; idx < x.getDBUniqueCount(); ++idx) {
2351  this->addDBUnique(x.getDBUnique(idx));
2352  }
2353  }
2354  //else {
2355  // copyTraits<dBUnique_type>::copyNeededFields(x.getDBUnique(), this->dBUnique());
2356  //}
2357  }
2358  }
2359  }
2360 }
2361 
2362 #include <istream>
2363 #include <xsd/cxx/xml/sax/std-input-source.hxx>
2364 #include <xsd/cxx/tree/error-handler.hxx>
2365 
2366 namespace nova
2367 {
2368  namespace dbi
2369  {
2370  ::std::unique_ptr< ::nova::dbi::dBTable >
2372  ::xml_schema::flags f,
2374  {
2375  ::xsd::cxx::xml::auto_initializer i (
2376  (f & ::xml_schema::flags::dont_initialize) == 0,
2377  (f & ::xml_schema::flags::keep_dom) == 0);
2378 
2379  ::xsd::cxx::tree::error_handler< char > h;
2380 
2381  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument > d (
2382  ::xsd::cxx::xml::dom::parse< char > (
2383  u, h, p, f));
2384 
2385  h.throw_if_failed< ::xsd::cxx::tree::parsing< char > > ();
2386 
2387  return ::std::unique_ptr< ::nova::dbi::dBTable > (
2389  std::move (d), f | ::xml_schema::flags::own_dom, p));
2390  }
2391 
2392  ::std::unique_ptr< ::nova::dbi::dBTable >
2395  ::xml_schema::flags f,
2397  {
2398  ::xsd::cxx::xml::auto_initializer i (
2399  (f & ::xml_schema::flags::dont_initialize) == 0,
2400  (f & ::xml_schema::flags::keep_dom) == 0);
2401 
2402  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument > d (
2403  ::xsd::cxx::xml::dom::parse< char > (
2404  u, h, p, f));
2405 
2406  if (!d.get ())
2407  throw ::xsd::cxx::tree::parsing< char > ();
2408 
2409  return ::std::unique_ptr< ::nova::dbi::dBTable > (
2411  std::move (d), f | ::xml_schema::flags::own_dom, p));
2412  }
2413 
2414  ::std::unique_ptr< ::nova::dbi::dBTable >
2416  ::xercesc::DOMErrorHandler& h,
2417  ::xml_schema::flags f,
2419  {
2420  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument > d (
2421  ::xsd::cxx::xml::dom::parse< char > (
2422  u, h, p, f));
2423 
2424  if (!d.get ())
2425  throw ::xsd::cxx::tree::parsing< char > ();
2426 
2427  return ::std::unique_ptr< ::nova::dbi::dBTable > (
2429  std::move (d), f | ::xml_schema::flags::own_dom, p));
2430  }
2431 
2432  ::std::unique_ptr< ::nova::dbi::dBTable >
2433  dBTable_ (::std::istream& is,
2434  ::xml_schema::flags f,
2436  {
2437  ::xsd::cxx::xml::auto_initializer i (
2438  (f & ::xml_schema::flags::dont_initialize) == 0,
2439  (f & ::xml_schema::flags::keep_dom) == 0);
2440 
2441  ::xsd::cxx::xml::sax::std_input_source isrc (is);
2442  return ::nova::dbi::dBTable_ (isrc, f, p);
2443  }
2444 
2445  ::std::unique_ptr< ::nova::dbi::dBTable >
2446  dBTable_ (::std::istream& is,
2448  ::xml_schema::flags f,
2450  {
2451  ::xsd::cxx::xml::auto_initializer i (
2452  (f & ::xml_schema::flags::dont_initialize) == 0,
2453  (f & ::xml_schema::flags::keep_dom) == 0);
2454 
2455  ::xsd::cxx::xml::sax::std_input_source isrc (is);
2456  return ::nova::dbi::dBTable_ (isrc, h, f, p);
2457  }
2458 
2459  ::std::unique_ptr< ::nova::dbi::dBTable >
2460  dBTable_ (::std::istream& is,
2461  ::xercesc::DOMErrorHandler& h,
2462  ::xml_schema::flags f,
2464  {
2465  ::xsd::cxx::xml::sax::std_input_source isrc (is);
2466  return ::nova::dbi::dBTable_ (isrc, h, f, p);
2467  }
2468 
2469  ::std::unique_ptr< ::nova::dbi::dBTable >
2470  dBTable_ (::std::istream& is,
2471  const ::std::string& sid,
2472  ::xml_schema::flags f,
2474  {
2475  ::xsd::cxx::xml::auto_initializer i (
2476  (f & ::xml_schema::flags::dont_initialize) == 0,
2477  (f & ::xml_schema::flags::keep_dom) == 0);
2478 
2479  ::xsd::cxx::xml::sax::std_input_source isrc (is, sid);
2480  return ::nova::dbi::dBTable_ (isrc, f, p);
2481  }
2482 
2483  ::std::unique_ptr< ::nova::dbi::dBTable >
2484  dBTable_ (::std::istream& is,
2485  const ::std::string& sid,
2487  ::xml_schema::flags f,
2489  {
2490  ::xsd::cxx::xml::auto_initializer i (
2491  (f & ::xml_schema::flags::dont_initialize) == 0,
2492  (f & ::xml_schema::flags::keep_dom) == 0);
2493 
2494  ::xsd::cxx::xml::sax::std_input_source isrc (is, sid);
2495  return ::nova::dbi::dBTable_ (isrc, h, f, p);
2496  }
2497 
2498  ::std::unique_ptr< ::nova::dbi::dBTable >
2499  dBTable_ (::std::istream& is,
2500  const ::std::string& sid,
2501  ::xercesc::DOMErrorHandler& h,
2502  ::xml_schema::flags f,
2504  {
2505  ::xsd::cxx::xml::sax::std_input_source isrc (is, sid);
2506  return ::nova::dbi::dBTable_ (isrc, h, f, p);
2507  }
2508 
2509  ::std::unique_ptr< ::nova::dbi::dBTable >
2510  dBTable_ (::xercesc::InputSource& i,
2511  ::xml_schema::flags f,
2513  {
2514  ::xsd::cxx::tree::error_handler< char > h;
2515 
2516  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument > d (
2517  ::xsd::cxx::xml::dom::parse< char > (
2518  i, h, p, f));
2519 
2520  h.throw_if_failed< ::xsd::cxx::tree::parsing< char > > ();
2521 
2522  return ::std::unique_ptr< ::nova::dbi::dBTable > (
2524  std::move (d), f | ::xml_schema::flags::own_dom, p));
2525  }
2526 
2527  ::std::unique_ptr< ::nova::dbi::dBTable >
2528  dBTable_ (::xercesc::InputSource& i,
2530  ::xml_schema::flags f,
2532  {
2533  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument > d (
2534  ::xsd::cxx::xml::dom::parse< char > (
2535  i, h, p, f));
2536 
2537  if (!d.get ())
2538  throw ::xsd::cxx::tree::parsing< char > ();
2539 
2540  return ::std::unique_ptr< ::nova::dbi::dBTable > (
2542  std::move (d), f | ::xml_schema::flags::own_dom, p));
2543  }
2544 
2545  ::std::unique_ptr< ::nova::dbi::dBTable >
2546  dBTable_ (::xercesc::InputSource& i,
2547  ::xercesc::DOMErrorHandler& h,
2548  ::xml_schema::flags f,
2550  {
2551  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument > d (
2552  ::xsd::cxx::xml::dom::parse< char > (
2553  i, h, p, f));
2554 
2555  if (!d.get ())
2556  throw ::xsd::cxx::tree::parsing< char > ();
2557 
2558  return ::std::unique_ptr< ::nova::dbi::dBTable > (
2560  std::move (d), f | ::xml_schema::flags::own_dom, p));
2561  }
2562 
2563  ::std::unique_ptr< ::nova::dbi::dBTable >
2564  dBTable_ (const ::xercesc::DOMDocument& doc,
2565  ::xml_schema::flags f,
2567  {
2568  if (f & ::xml_schema::flags::keep_dom)
2569  {
2570  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument > d (
2571  static_cast< ::xercesc::DOMDocument* > (doc.cloneNode (true)));
2572 
2573  return ::std::unique_ptr< ::nova::dbi::dBTable > (
2575  std::move (d), f | ::xml_schema::flags::own_dom, p));
2576  }
2577 
2578  const ::xercesc::DOMElement& e (*doc.getDocumentElement ());
2579  const ::xsd::cxx::xml::qualified_name< char > n (
2580  ::xsd::cxx::xml::dom::name< char > (e));
2581 
2582  if (n.name () == "dBTable" &&
2583  n.namespace_ () == "")
2584  {
2585  ::std::unique_ptr< ::nova::dbi::dBTable > r (
2586  ::xsd::cxx::tree::traits< ::nova::dbi::dBTable, char >::create (
2587  e, f, 0));
2588  return r;
2589  }
2590 
2591  throw ::xsd::cxx::tree::unexpected_element < char > (
2592  n.name (),
2593  n.namespace_ (),
2594  "dBTable",
2595  "");
2596  }
2597 
2598  ::std::unique_ptr< ::nova::dbi::dBTable >
2599  dBTable_ (::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument > d,
2600  ::xml_schema::flags f,
2602  {
2603  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument > c (
2604  ((f & ::xml_schema::flags::keep_dom) &&
2605  !(f & ::xml_schema::flags::own_dom))
2606  ? static_cast< ::xercesc::DOMDocument* > (d->cloneNode (true))
2607  : 0);
2608 
2609  ::xercesc::DOMDocument& doc (c.get () ? *c : *d);
2610  const ::xercesc::DOMElement& e (*doc.getDocumentElement ());
2611 
2612  const ::xsd::cxx::xml::qualified_name< char > n (
2613  ::xsd::cxx::xml::dom::name< char > (e));
2614 
2615  if (f & ::xml_schema::flags::keep_dom)
2616  doc.setUserData (::xml_schema::dom::tree_node_key,
2617  (c.get () ? &c : &d),
2618  0);
2619 
2620  if (n.name () == "dBTable" &&
2621  n.namespace_ () == "")
2622  {
2623  ::std::unique_ptr< ::nova::dbi::dBTable > r (
2624  ::xsd::cxx::tree::traits< ::nova::dbi::dBTable, char >::create (
2625  e, f, 0));
2626  return r;
2627  }
2628 
2629  throw ::xsd::cxx::tree::unexpected_element < char > (
2630  n.name (),
2631  n.namespace_ (),
2632  "dBTable",
2633  "");
2634  }
2635  }
2636 }
2637 
2638 #include <ostream>
2639 #include <xsd/cxx/tree/error-handler.hxx>
2640 #include <xsd/cxx/xml/dom/serialization-source.hxx>
2641 
2642 namespace nova
2643 {
2644  namespace dbi
2645  {
2646  void
2647  dBTable_ (::std::ostream& o,
2648  const ::nova::dbi::dBTable& s,
2651  ::xml_schema::flags f)
2652  {
2653  ::xsd::cxx::xml::auto_initializer i (
2654  (f & ::xml_schema::flags::dont_initialize) == 0);
2655 
2656  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument > d (
2657  ::nova::dbi::dBTable_ (s, m, f));
2658 
2659  ::xsd::cxx::tree::error_handler< char > h;
2660 
2661  ::xsd::cxx::xml::dom::ostream_format_target t (o);
2662  if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
2663  {
2664  h.throw_if_failed< ::xsd::cxx::tree::serialization< char > > ();
2665  }
2666  }
2667 
2668  void
2669  dBTable_ (::std::ostream& o,
2670  const ::nova::dbi::dBTable& s,
2674  ::xml_schema::flags f)
2675  {
2676  ::xsd::cxx::xml::auto_initializer i (
2677  (f & ::xml_schema::flags::dont_initialize) == 0);
2678 
2679  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument > d (
2680  ::nova::dbi::dBTable_ (s, m, f));
2681  ::xsd::cxx::xml::dom::ostream_format_target t (o);
2682  if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
2683  {
2684  throw ::xsd::cxx::tree::serialization< char > ();
2685  }
2686  }
2687 
2688  void
2689  dBTable_ (::std::ostream& o,
2690  const ::nova::dbi::dBTable& s,
2691  ::xercesc::DOMErrorHandler& h,
2694  ::xml_schema::flags f)
2695  {
2696  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument > d (
2697  ::nova::dbi::dBTable_ (s, m, f));
2698  ::xsd::cxx::xml::dom::ostream_format_target t (o);
2699  if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
2700  {
2701  throw ::xsd::cxx::tree::serialization< char > ();
2702  }
2703  }
2704 
2705  void
2706  dBTable_ (::xercesc::XMLFormatTarget& t,
2707  const ::nova::dbi::dBTable& s,
2710  ::xml_schema::flags f)
2711  {
2712  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument > d (
2713  ::nova::dbi::dBTable_ (s, m, f));
2714 
2715  ::xsd::cxx::tree::error_handler< char > h;
2716 
2717  if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
2718  {
2719  h.throw_if_failed< ::xsd::cxx::tree::serialization< char > > ();
2720  }
2721  }
2722 
2723  void
2724  dBTable_ (::xercesc::XMLFormatTarget& t,
2725  const ::nova::dbi::dBTable& s,
2729  ::xml_schema::flags f)
2730  {
2731  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument > d (
2732  ::nova::dbi::dBTable_ (s, m, f));
2733  if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
2734  {
2735  throw ::xsd::cxx::tree::serialization< char > ();
2736  }
2737  }
2738 
2739  void
2740  dBTable_ (::xercesc::XMLFormatTarget& t,
2741  const ::nova::dbi::dBTable& s,
2742  ::xercesc::DOMErrorHandler& h,
2745  ::xml_schema::flags f)
2746  {
2747  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument > d (
2748  ::nova::dbi::dBTable_ (s, m, f));
2749  if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
2750  {
2751  throw ::xsd::cxx::tree::serialization< char > ();
2752  }
2753  }
2754 
2755  void
2756  dBTable_ (::xercesc::DOMDocument& d,
2757  const ::nova::dbi::dBTable& s,
2759  {
2760  ::xercesc::DOMElement& e (*d.getDocumentElement ());
2761  const ::xsd::cxx::xml::qualified_name< char > n (
2762  ::xsd::cxx::xml::dom::name< char > (e));
2763 
2764  if (n.name () == "dBTable" &&
2765  n.namespace_ () == "")
2766  {
2767  e << s;
2768  }
2769  else
2770  {
2771  throw ::xsd::cxx::tree::unexpected_element < char > (
2772  n.name (),
2773  n.namespace_ (),
2774  "dBTable",
2775  "");
2776  }
2777  }
2778 
2779  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument >
2780  dBTable_ (const ::nova::dbi::dBTable& s,
2782  ::xml_schema::flags f)
2783  {
2784  ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument > d (
2785  ::xsd::cxx::xml::dom::serialize< char > (
2786  "dBTable",
2787  "",
2788  m, f));
2789 
2790  ::nova::dbi::dBTable_ (*d, s, f);
2791  return d;
2792  }
2793 
2794  void
2795  operator<< (::xercesc::DOMElement& e, const dBColumn_t& i)
2796  {
2797  e << static_cast< const ::xml_schema::type& > (i);
2798 
2799  // name
2800  //
2801  {
2802  ::xercesc::DOMAttr& a (
2803  ::xsd::cxx::xml::dom::create_attribute (
2804  "name",
2805  e));
2806 
2807  if (! i.hasName ()) {
2808  std::cerr << "WARNING: attempting to serialize a dBColumn_t with an empty name field!" << std::endl;
2809  }
2810  a << i.name ();
2811  }
2812 
2813  // colType
2814  //
2815  if (i.colType ())
2816  {
2817  ::xercesc::DOMAttr& a (
2818  ::xsd::cxx::xml::dom::create_attribute (
2819  "colType",
2820  e));
2821 
2822  a << *i.colType ();
2823  }
2824 
2825  // value
2826  //
2827  if (i.value ())
2828  {
2829  ::xercesc::DOMAttr& a (
2830  ::xsd::cxx::xml::dom::create_attribute (
2831  "value",
2832  e));
2833 
2834  a << *i.value ();
2835  }
2836 
2837  // null
2838  //
2839  if (i.null ())
2840  {
2841  ::xercesc::DOMAttr& a (
2842  ::xsd::cxx::xml::dom::create_attribute (
2843  "null",
2844  e));
2845 
2846  a << *i.null ();
2847  }
2848 
2849  // fKeyTable
2850  //
2851  if (i.fKeyTable ())
2852  {
2853  ::xercesc::DOMAttr& a (
2854  ::xsd::cxx::xml::dom::create_attribute (
2855  "fKeyTable",
2856  e));
2857 
2858  a << *i.fKeyTable ();
2859  }
2860 
2861  // fKeyColumn
2862  //
2863  if (i.fKeyColumn ())
2864  {
2865  ::xercesc::DOMAttr& a (
2866  ::xsd::cxx::xml::dom::create_attribute (
2867  "fKeyColumn",
2868  e));
2869 
2870  a << *i.fKeyColumn ();
2871  }
2872 
2873  // tolerance
2874  //
2875  if (i.tolerance ())
2876  {
2877  ::xercesc::DOMAttr& a (
2878  ::xsd::cxx::xml::dom::create_attribute (
2879  "tolerance",
2880  e));
2881 
2882  a << *i.tolerance ();
2883  }
2884  }
2885 
2886  void
2887  operator<< (::xercesc::DOMElement& e, const dBCheck_t& i)
2888  {
2889  e << static_cast< const ::xml_schema::type& > (i);
2890 
2891  // constraint
2892  //
2893  {
2894  ::xercesc::DOMAttr& a (
2895  ::xsd::cxx::xml::dom::create_attribute (
2896  "constraint",
2897  e));
2898 
2899  if (! i.hasConstraint ()) {
2900  std::cerr << "WARNING: attempting to serialize a dBCheck_t with an empty constraint field!" << std::endl;
2901  }
2902  a << i.constraint ();
2903  }
2904  }
2905 
2906  void
2907  operator<< (::xercesc::DOMElement& e, const dBRow_t& i)
2908  {
2909  e << static_cast< const ::xml_schema::type& > (i);
2910 
2911  // dBCol
2912  //
2914  b (i.dBCol ().begin ()), n (i.dBCol ().end ());
2915  b != n; ++b)
2916  {
2917  ::xercesc::DOMElement& s (
2918  ::xsd::cxx::xml::dom::create_element (
2919  "dBCol",
2920  e));
2921 
2922  s << *b;
2923  }
2924  }
2925 
2926  void
2927  operator<< (::xercesc::DOMElement& e, const dBTable& i)
2928  {
2929  e << static_cast< const ::xml_schema::type& > (i);
2930 
2931  // dBColumn
2932  //
2934  b (i.dBColumn ().begin ()), n (i.dBColumn ().end ());
2935  b != n; ++b)
2936  {
2937  ::xercesc::DOMElement& s (
2938  ::xsd::cxx::xml::dom::create_element (
2939  "dBColumn",
2940  e));
2941 
2942  s << *b;
2943  }
2944 
2945  // dBPKey
2946  //
2947  if (i.dBPKey ())
2948  {
2949  ::xercesc::DOMElement& s (
2950  ::xsd::cxx::xml::dom::create_element (
2951  "dBPKey",
2952  e));
2953 
2954  s << *i.dBPKey ();
2955  }
2956 
2957  // dBUnique
2958  //
2960  b (i.dBUnique ().begin ()), n (i.dBUnique ().end ());
2961  b != n; ++b)
2962  {
2963  ::xercesc::DOMElement& s (
2964  ::xsd::cxx::xml::dom::create_element (
2965  "dBUnique",
2966  e));
2967 
2968  s << *b;
2969  }
2970 
2971  // dBCheck
2972  //
2974  b (i.dBCheck ().begin ()), n (i.dBCheck ().end ());
2975  b != n; ++b)
2976  {
2977  ::xercesc::DOMElement& s (
2978  ::xsd::cxx::xml::dom::create_element (
2979  "dBCheck",
2980  e));
2981 
2982  s << *b;
2983  }
2984 
2985  // dBRow
2986  //
2988  b (i.dBRow ().begin ()), n (i.dBRow ().end ());
2989  b != n; ++b)
2990  {
2991  ::xercesc::DOMElement& s (
2992  ::xsd::cxx::xml::dom::create_element (
2993  "dBRow",
2994  e));
2995 
2996  s << *b;
2997  }
2998 
2999  // tableName
3000  //
3001  {
3002  ::xercesc::DOMAttr& a (
3003  ::xsd::cxx::xml::dom::create_attribute (
3004  "tableName",
3005  e));
3006 
3007  if (! i.hasTableName ()) {
3008  std::cerr << "WARNING: attempting to serialize a dBTable with an empty tableName field!" << std::endl;
3009  }
3010  a << i.tableName ();
3011  }
3012 
3013  // dbHost
3014  //
3015  {
3016  ::xercesc::DOMAttr& a (
3017  ::xsd::cxx::xml::dom::create_attribute (
3018  "dbHost",
3019  e));
3020 
3021  if (! i.hasDbHost ()) {
3022  std::cerr << "WARNING: attempting to serialize a dBTable with an empty dbHost field!" << std::endl;
3023  }
3024  a << i.dbHost ();
3025  }
3026 
3027  // dbName
3028  //
3029  {
3030  ::xercesc::DOMAttr& a (
3031  ::xsd::cxx::xml::dom::create_attribute (
3032  "dbName",
3033  e));
3034 
3035  if (! i.hasDbName ()) {
3036  std::cerr << "WARNING: attempting to serialize a dBTable with an empty dbName field!" << std::endl;
3037  }
3038  a << i.dbName ();
3039  }
3040 
3041  // dbType
3042  //
3043  if (i.dbType ())
3044  {
3045  ::xercesc::DOMAttr& a (
3046  ::xsd::cxx::xml::dom::create_attribute (
3047  "dbType",
3048  e));
3049 
3050  a << *i.dbType ();
3051  }
3052 
3053  // dbPort
3054  //
3055  if (i.dbPort ())
3056  {
3057  ::xercesc::DOMAttr& a (
3058  ::xsd::cxx::xml::dom::create_attribute (
3059  "dbPort",
3060  e));
3061 
3062  a << *i.dbPort ();
3063  }
3064 
3065  // tableType
3066  //
3067  if (i.tableType ())
3068  {
3069  ::xercesc::DOMAttr& a (
3070  ::xsd::cxx::xml::dom::create_attribute (
3071  "tableType",
3072  e));
3073 
3074  a << *i.tableType ();
3075  }
3076 
3077  // creationDate
3078  //
3079  if (i.creationDate ())
3080  {
3081  ::xercesc::DOMAttr& a (
3082  ::xsd::cxx::xml::dom::create_attribute (
3083  "creationDate",
3084  e));
3085 
3086  a << *i.creationDate ();
3087  }
3088 
3089  // maintainer
3090  //
3091  if (i.maintainer ())
3092  {
3093  ::xercesc::DOMAttr& a (
3094  ::xsd::cxx::xml::dom::create_attribute (
3095  "maintainer",
3096  e));
3097 
3098  a << *i.maintainer ();
3099  }
3100 
3101  // xmlOverDB
3102  //
3103  if (i.xmlOverDB ())
3104  {
3105  ::xercesc::DOMAttr& a (
3106  ::xsd::cxx::xml::dom::create_attribute (
3107  "xmlOverDB",
3108  e));
3109 
3110  a << *i.xmlOverDB ();
3111  }
3112 
3113  // ignoreDB
3114  //
3115  if (i.ignoreDB ())
3116  {
3117  ::xercesc::DOMAttr& a (
3118  ::xsd::cxx::xml::dom::create_attribute (
3119  "ignoreDB",
3120  e));
3121 
3122  a << *i.ignoreDB ();
3123  }
3124 
3125  // addInsertTime
3126  //
3127  if (i.addInsertTime ())
3128  {
3129  ::xercesc::DOMAttr& a (
3130  ::xsd::cxx::xml::dom::create_attribute (
3131  "addInsertTime",
3132  e));
3133 
3134  a << *i.addInsertTime ();
3135  }
3136 
3137  // addInsertUser
3138  //
3139  if (i.addInsertUser ())
3140  {
3141  ::xercesc::DOMAttr& a (
3142  ::xsd::cxx::xml::dom::create_attribute (
3143  "addInsertUser",
3144  e));
3145 
3146  a << *i.addInsertUser ();
3147  }
3148 
3149  // addUpdateTime
3150  //
3151  if (i.addUpdateTime ())
3152  {
3153  ::xercesc::DOMAttr& a (
3154  ::xsd::cxx::xml::dom::create_attribute (
3155  "addUpdateTime",
3156  e));
3157 
3158  a << *i.addUpdateTime ();
3159  }
3160 
3161  // addUpdateUser
3162  //
3163  if (i.addUpdateUser ())
3164  {
3165  ::xercesc::DOMAttr& a (
3166  ::xsd::cxx::xml::dom::create_attribute (
3167  "addUpdateUser",
3168  e));
3169 
3170  a << *i.addUpdateUser ();
3171  }
3172 
3173  // schema
3174  //
3175  if (i.schema ())
3176  {
3177  ::xercesc::DOMAttr& a (
3178  ::xsd::cxx::xml::dom::create_attribute (
3179  "schema",
3180  e));
3181 
3182  a << *i.schema ();
3183  }
3184  }
3185  }
3186 }
3187 
3188 #include <xsd/cxx/post.hxx>
3189 
3190 // Begin epilogue.
3191 //
3192 //
3193 // End epilogue.
3194 
void setDbPort(const dbPort_type &x)
Definition: Database.cpp:1001
maintainer_optional maintainer_
Definition: Database.h:1327
static void copyNeededFields(dBCheck_t const &source, Y &target)
Definition: Database.cpp:62
const xmlOverDB_type & getXmlOverDB() const
Definition: Database.cpp:1175
void removeAllDBColumn()
Definition: Database.cpp:569
dBColumn_t & operator=(const dBColumn_t &x)
Definition: Database.cpp:1609
::xsd::cxx::tree::optional< value_type > value_optional
Definition: Database.h:352
dBRow_t & operator=(const dBRow_t &x)
Definition: Database.cpp:1816
const XML_Char * name
Definition: expat.h:151
static void copyNeededFields(dBTable const &source, dBTable &target)
Definition: Database.cpp:94
::xsd::cxx::tree::optional< creationDate_type > creationDate_optional
Definition: Database.h:1020
void setIgnoreDB(const ignoreDB_type &x)
Definition: Database.cpp:1235
::xml_schema::string fKeyTable_type
Definition: Database.h:408
dbType_optional dbType_
Definition: Database.h:1323
tableType_optional tableType_
Definition: Database.h:1325
const dBCol_type & getDBCol(int index) const
Definition: Database.cpp:493
void addDBCheck(const dBCheck_type &newDBCheck)
Definition: Database.cpp:737
void setTableName(const tableName_type &x)
Definition: Database.cpp:827
const value_optional & value() const
Definition: Database.cpp:197
const tolerance_type & getTolerance() const
Definition: Database.cpp:395
::xsd::cxx::tree::optional< addInsertTime_type > addInsertTime_optional
Definition: Database.h:1134
::xsd::cxx::tree::optional< dbPort_type > dbPort_optional
Definition: Database.h:960
dBTable & operator=(const dBTable &x)
Definition: Database.cpp:2175
bool hasNull() const
Definition: Database.cpp:263
bool hasName() const
Definition: Database.cpp:125
::xml_schema::integer getDBCheckCount() const
Definition: Database.cpp:701
const XML_Char * target
Definition: expat.h:268
::xsd::cxx::tree::one< dbName_type > dbName_
Definition: Database.h:1322
::xml_schema::integer getDBColCount() const
Definition: Database.cpp:487
void setConstraint(const constraint_type &x)
Definition: Database.cpp:459
const addInsertUser_type & getAddInsertUser() const
Definition: Database.cpp:1301
bool hasMaintainer() const
Definition: Database.cpp:1133
::xsd::cxx::tree::optional< schema_type > schema_optional
Definition: Database.h:1242
dBCol_sequence dBCol_
Definition: Database.h:672
::xsd::cxx::tree::flags flags
Definition: Database.h:214
const dBCol_sequence & dBCol() const
Definition: Database.cpp:475
const schema_optional & schema() const
Definition: Database.cpp:1415
dBColumn_type & getDBColumnReference(int index)
Definition: Database.cpp:557
void parse(::xsd::cxx::xml::dom::parser< char > &,::xml_schema::flags)
Definition: Database.cpp:1537
const addInsertTime_optional & addInsertTime() const
Definition: Database.cpp:1247
ignoreDB_optional ignoreDB_
Definition: Database.h:1329
bool hasIgnoreDB() const
Definition: Database.cpp:1223
::xsd::cxx::tree::optional< fKeyColumn_type > fKeyColumn_optional
Definition: Database.h:439
const addUpdateTime_type & getAddUpdateTime() const
Definition: Database.cpp:1343
::xsd::cxx::tree::optional< tableType_type > tableType_optional
Definition: Database.h:990
const dbPort_type & getDbPort() const
Definition: Database.cpp:983
const name_type & name() const
Definition: Database.cpp:107
const dBCheck_sequence & dBCheck() const
Definition: Database.cpp:689
const dBColumn_type & getDBColumn(int index) const
Definition: Database.cpp:551
virtual ::boost::shared_ptr< ::novadaq::XMLSerializable > clone() const
Definition: Database.cpp:2266
::xml_schema::boolean xmlOverDB_type
Definition: Database.h:1079
void setSchema(const schema_type &x)
Definition: Database.cpp:1445
void addDBCol(const dBCol_type &newDBCol)
Definition: Database.cpp:523
::xsd::cxx::tree::sequence< dBCheck_type > dBCheck_sequence
Definition: Database.h:782
bool hasTolerance() const
Definition: Database.cpp:401
::xml_schema::string constraint_type
Definition: Database.h:541
::xsd::cxx::tree::one< constraint_type > constraint_
Definition: Database.h:599
void addDBColumn(const dBColumn_type &newDBColumn)
Definition: Database.cpp:581
const char * p
Definition: xmltok.h:285
const null_optional & null() const
Definition: Database.cpp:245
::xml_schema::string schema_type
Definition: Database.h:1241
bool hasXmlOverDB() const
Definition: Database.cpp:1181
const dBPKey_optional & dBPKey() const
Definition: Database.cpp:587
bool hasAddUpdateTime() const
Definition: Database.cpp:1349
const constraint_type & getConstraint() const
Definition: Database.cpp:441
dbPort_optional dbPort_
Definition: Database.h:1324
::xml_schema::string creationDate_type
Definition: Database.h:1019
OStream cerr
Definition: OStream.cxx:7
addUpdateTime_optional addUpdateTime_
Definition: Database.h:1332
::std::string serialize() const
Definition: Database.cpp:2211
::xml_schema::integer getDBUniqueCount() const
Definition: Database.cpp:647
::xsd::cxx::tree::optional< addUpdateUser_type > addUpdateUser_optional
Definition: Database.h:1215
::xml_schema::string colType_type
Definition: Database.h:321
static void copyNeededFields(dBColumn_t const &source, Y &target)
Definition: Database.cpp:74
static void copyNeededFields(dBTable const &source, Y &target)
Definition: Database.cpp:98
virtual dBCheck_t * _clone(::xml_schema::flags f=0,::xml_schema::container *c=0) const
Definition: Database.cpp:1714
const dbHost_type & getDbHost() const
Definition: Database.cpp:851
void copyNeededFields(const dBCheck_t &x)
Definition: Database.cpp:1738
void registerClass(std::string className, boost::shared_ptr< XMLSerializable > classInstance)
dBUnique_sequence::const_iterator dBUnique_const_iterator
Definition: Database.h:749
const fKeyTable_optional & fKeyTable() const
Definition: Database.cpp:287
::xml_schema::string tableName_type
Definition: Database.h:851
creationDate_optional creationDate_
Definition: Database.h:1326
::xml_schema::string fKeyColumn_type
Definition: Database.h:438
const colType_type & getColType() const
Definition: Database.cpp:161
void deserialize(const ::std::string &)
Definition: Database.cpp:2227
bool hasCreationDate() const
Definition: Database.cpp:1085
::xml_schema::boolean null_type
Definition: Database.h:381
dBCheck_sequence::const_iterator dBCheck_const_iterator
Definition: Database.h:784
const XML_Char int const XML_Char int const XML_Char * base
Definition: expat.h:331
::xsd::cxx::tree::optional< fKeyTable_type > fKeyTable_optional
Definition: Database.h:409
void addDBUnique(const dBUnique_type &newDBUnique)
Definition: Database.cpp:683
static const unsigned long allow_missing_elements
::xml_schema::string dbType_type
Definition: Database.h:929
dBColumn_sequence::const_iterator dBColumn_const_iterator
Definition: Database.h:684
void setDbHost(const dbHost_type &x)
Definition: Database.cpp:869
double value_
bool hasDbType() const
Definition: Database.cpp:941
const fKeyColumn_type & getFKeyColumn() const
Definition: Database.cpp:347
void setDBPKey(const dBPKey_type &x)
Definition: Database.cpp:617
Float_t Y
Definition: plot.C:38
::xml_schema::boolean addUpdateTime_type
Definition: Database.h:1187
::xsd::cxx::tree::type type
Definition: Database.h:110
::std::unique_ptr< ::nova::dbi::dBTable > dBTable_(const ::std::string &uri,::xml_schema::flags f=0, const ::xml_schema::properties &p=::xml_schema::properties())
Definition: Database.cpp:2371
bool hasColType() const
Definition: Database.cpp:167
::xsd::cxx::tree::optional< dBPKey_type > dBPKey_optional
Definition: Database.h:717
static void copyNeededFields(X const &source, X &target)
Definition: Database.cpp:50
void copyNeededFields(const dBRow_t &x)
Definition: Database.cpp:1833
dBColumn_sequence dBColumn_
Definition: Database.h:1315
bool hasDbPort() const
Definition: Database.cpp:989
const dBColumn_sequence & dBColumn() const
Definition: Database.cpp:533
::xsd::cxx::tree::one< tableName_type > tableName_
Definition: Database.h:1320
bool hasDbHost() const
Definition: Database.cpp:857
::xsd::cxx::tree::optional< xmlOverDB_type > xmlOverDB_optional
Definition: Database.h:1080
const XML_Char * s
Definition: expat.h:262
void copyNeededFields(const dBColumn_t &x)
Definition: Database.cpp:1632
const fKeyTable_type & getFKeyTable() const
Definition: Database.cpp:299
void setTolerance(const tolerance_type &x)
Definition: Database.cpp:413
::xsd::cxx::tree::sequence< dBRow_type > dBRow_sequence
Definition: Database.h:817
const ignoreDB_optional & ignoreDB() const
Definition: Database.cpp:1205
::xsd::cxx::tree::optional< addUpdateTime_type > addUpdateTime_optional
Definition: Database.h:1188
tolerance_optional tolerance_
Definition: Database.h:533
void addDBRow(const dBRow_type &newDBRow)
Definition: Database.cpp:791
const dbType_type & getDbType() const
Definition: Database.cpp:935
void setAddInsertTime(const addInsertTime_type &x)
Definition: Database.cpp:1277
const tableName_type & getTableName() const
Definition: Database.cpp:809
dBPKey_optional dBPKey_
Definition: Database.h:1316
::xml_schema::string name_type
Definition: Database.h:295
::xsd::cxx::tree::optional< colType_type > colType_optional
Definition: Database.h:322
void setFKeyColumn(const fKeyColumn_type &x)
Definition: Database.cpp:365
void setTableType(const tableType_type &x)
Definition: Database.cpp:1049
::xsd::cxx::tree::optional< dbType_type > dbType_optional
Definition: Database.h:930
dBUnique_type & getDBUniqueReference(int index)
Definition: Database.cpp:659
bool hasAddInsertUser() const
Definition: Database.cpp:1307
void parse(::xsd::cxx::xml::dom::parser< char > &,::xml_schema::flags)
Definition: Database.cpp:1784
bool hasConstraint() const
Definition: Database.cpp:447
dBCol_type & getDBColReference(int index)
Definition: Database.cpp:499
value_optional value_
Definition: Database.h:529
const tableType_optional & tableType() const
Definition: Database.cpp:1019
bool hasTableName() const
Definition: Database.cpp:815
::xsd::cxx::tree::sequence< dBCol_type > dBCol_sequence
Definition: Database.h:608
fKeyTable_optional fKeyTable_
Definition: Database.h:531
void setXmlOverDB(const xmlOverDB_type &x)
Definition: Database.cpp:1193
const creationDate_optional & creationDate() const
Definition: Database.cpp:1067
::xml_schema::integer getDBColumnCount() const
Definition: Database.cpp:545
dBCheck_sequence dBCheck_
Definition: Database.h:1318
::xml_schema::string dbName_type
Definition: Database.h:903
addInsertTime_optional addInsertTime_
Definition: Database.h:1330
void parse(::xsd::cxx::xml::dom::parser< char > &,::xml_schema::flags)
Definition: Database.cpp:1966
const dBCheck_type & getDBCheck(int index) const
Definition: Database.cpp:707
const tolerance_optional & tolerance() const
Definition: Database.cpp:383
xmlOverDB_optional xmlOverDB_
Definition: Database.h:1328
const double a
void removeAllDBCheck()
Definition: Database.cpp:725
virtual dBColumn_t * _clone(::xml_schema::flags f=0,::xml_schema::container *c=0) const
Definition: Database.cpp:1602
const value_type & getValue() const
Definition: Database.cpp:209
void parse(::xsd::cxx::xml::dom::parser< char > &,::xml_schema::flags)
Definition: Database.cpp:1685
static void copyNeededFields(dBColumn_t const &source, dBColumn_t &target)
Definition: Database.cpp:70
const addUpdateTime_optional & addUpdateTime() const
Definition: Database.cpp:1331
const dbName_type & getDbName() const
Definition: Database.cpp:893
::xsd::cxx::xml::dom::namespace_infomap< char > namespace_infomap
Definition: Database.h:206
virtual ~dBRow_t()
Definition: Database.cpp:1828
static void copyNeededFields(dBCheck_t const &source, dBCheck_t &target)
Definition: Database.cpp:58
static void registerForDeserialization()
Definition: Database.cpp:2274
Float_t d
Definition: plot.C:236
bool hasDBPKey() const
Definition: Database.cpp:605
bool hasAddInsertTime() const
Definition: Database.cpp:1265
void setName(const name_type &x)
Definition: Database.cpp:137
bool hasTableType() const
Definition: Database.cpp:1037
::xsd::cxx::xml::error_handler< char > error_handler
Definition: Database.h:239
const dBUnique_sequence & dBUnique() const
Definition: Database.cpp:635
::xsd::cxx::tree::optional< tolerance_type > tolerance_optional
Definition: Database.h:469
const XMLCh *const tree_node_key
Definition: Database.h:253
::xsd::cxx::tree::properties< char > properties
Definition: Database.h:215
fKeyColumn_optional fKeyColumn_
Definition: Database.h:532
dBCol_sequence::const_iterator dBCol_const_iterator
Definition: Database.h:610
virtual dBTable * _clone(::xml_schema::flags f=0,::xml_schema::container *c=0) const
Definition: Database.cpp:2168
static boost::mutex _serializationMutex
::xsd::cxx::tree::one< dbHost_type > dbHost_
Definition: Database.h:1321
Hold drift constants from current run.
Definition: DriftCache.h:17
schema_optional schema_
Definition: Database.h:1334
bool hasDBUnique() const
Definition: Database.cpp:665
addInsertUser_optional addInsertUser_
Definition: Database.h:1331
bool hasAddUpdateUser() const
Definition: Database.cpp:1391
static void copyNeededFields(dBRow_t const &source, Y &target)
Definition: Database.cpp:86
const dbHost_type & dbHost() const
Definition: Database.cpp:839
bool hasDBRow() const
Definition: Database.cpp:773
const fKeyColumn_optional & fKeyColumn() const
Definition: Database.cpp:335
const schema_type & getSchema() const
Definition: Database.cpp:1427
::xsd::cxx::tree::optional< ignoreDB_type > ignoreDB_optional
Definition: Database.h:1107
const dBUnique_type & getDBUnique(int index) const
Definition: Database.cpp:653
virtual ~dBTable()
Definition: Database.cpp:2206
void setAddUpdateUser(const addUpdateUser_type &x)
Definition: Database.cpp:1403
void setAddUpdateTime(const addUpdateTime_type &x)
Definition: Database.cpp:1361
const creationDate_type & getCreationDate() const
Definition: Database.cpp:1079
colType_optional colType_
Definition: Database.h:528
::xsd::cxx::tree::optional< addInsertUser_type > addInsertUser_optional
Definition: Database.h:1161
::xml_schema::string maintainer_type
Definition: Database.h:1049
const tableType_type & getTableType() const
Definition: Database.cpp:1031
bool hasFKeyColumn() const
Definition: Database.cpp:353
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
dBUnique_sequence dBUnique_
Definition: Database.h:1317
::xsd::cxx::tree::optional< maintainer_type > maintainer_optional
Definition: Database.h:1050
static XMLDeserializationRegistry & getInstance()
void setCreationDate(const creationDate_type &x)
Definition: Database.cpp:1097
void copyNeededFields(const dBTable &x)
Definition: Database.cpp:2284
null_optional null_
Definition: Database.h:530
const dBRow_type & getDBRow(int index) const
Definition: Database.cpp:761
::xml_schema::string value_type
Definition: Database.h:351
dBRow_sequence dBRow_
Definition: Database.h:1319
const colType_optional & colType() const
Definition: Database.cpp:149
dBRow_sequence::const_iterator dBRow_const_iterator
Definition: Database.h:819
::xml_schema::string tableType_type
Definition: Database.h:989
const maintainer_type & getMaintainer() const
Definition: Database.cpp:1127
::xml_schema::boolean addInsertUser_type
Definition: Database.h:1160
bool hasFKeyTable() const
Definition: Database.cpp:305
virtual ::std::string getClassName() const
Definition: Database.cpp:2260
::xsd::cxx::tree::sequence< dBUnique_type > dBUnique_sequence
Definition: Database.h:747
::xsd::cxx::tree::optional< null_type > null_optional
Definition: Database.h:382
static void copyNeededFields(dBRow_t const &source, dBRow_t &target)
Definition: Database.cpp:82
const addUpdateUser_optional & addUpdateUser() const
Definition: Database.cpp:1373
void setFKeyTable(const fKeyTable_type &x)
Definition: Database.cpp:317
::xml_schema::boolean ignoreDB_type
Definition: Database.h:1106
void removeAllDBUnique()
Definition: Database.cpp:671
const constraint_type & constraint() const
Definition: Database.cpp:429
const addUpdateUser_type & getAddUpdateUser() const
Definition: Database.cpp:1385
addUpdateUser_optional addUpdateUser_
Definition: Database.h:1333
void setDbName(const dbName_type &x)
Definition: Database.cpp:911
const hit & b
Definition: hits.cxx:21
const addInsertTime_type & getAddInsertTime() const
Definition: Database.cpp:1259
std::ostream & operator<<(std::ostream &stream, const Column &col)
Definition: Column.h:177
dBCheck_type & getDBCheckReference(int index)
Definition: Database.cpp:713
TRandom3 r(0)
const dBPKey_type & getDBPKey() const
Definition: Database.cpp:599
bool hasDBColumn() const
Definition: Database.cpp:563
const name_type & getName() const
Definition: Database.cpp:119
const dBRow_sequence & dBRow() const
Definition: Database.cpp:743
::xsd::cxx::tree::type container
Definition: Database.h:112
bool hasDBCol() const
Definition: Database.cpp:505
const dbType_optional & dbType() const
Definition: Database.cpp:923
const dbName_type & dbName() const
Definition: Database.cpp:881
::xml_schema::integer getDBRowCount() const
Definition: Database.cpp:755
bool hasValue() const
Definition: Database.cpp:215
::xml_schema::boolean addUpdateUser_type
Definition: Database.h:1214
bool hasDBCheck() const
Definition: Database.cpp:719
void setMaintainer(const maintainer_type &x)
Definition: Database.cpp:1145
void setColType(const colType_type &x)
Definition: Database.cpp:179
::xml_schema::string dbPort_type
Definition: Database.h:959
const maintainer_optional & maintainer() const
Definition: Database.cpp:1115
const null_type & getNull() const
Definition: Database.cpp:257
::xml_schema::float_ tolerance_type
Definition: Database.h:468
const dbPort_optional & dbPort() const
Definition: Database.cpp:971
Float_t e
Definition: plot.C:35
long long integer
Definition: Database.h:136
bool hasSchema() const
Definition: Database.cpp:1433
Float_t X
Definition: plot.C:38
const tableName_type & tableName() const
Definition: Database.cpp:797
void setAddInsertUser(const addInsertUser_type &x)
Definition: Database.cpp:1319
dBCheck_t & operator=(const dBCheck_t &x)
Definition: Database.cpp:1721
const addInsertUser_optional & addInsertUser() const
Definition: Database.cpp:1289
::xsd::cxx::tree::one< name_type > name_
Definition: Database.h:527
const ignoreDB_type & getIgnoreDB() const
Definition: Database.cpp:1217
void setValue(const value_type &x)
Definition: Database.cpp:227
static void copyNeededFields(X const &source, Y &target)
Definition: Database.cpp:52
::xsd::cxx::tree::sequence< dBColumn_type > dBColumn_sequence
Definition: Database.h:682
void setDbType(const dbType_type &x)
Definition: Database.cpp:953
virtual dBRow_t * _clone(::xml_schema::flags f=0,::xml_schema::container *c=0) const
Definition: Database.cpp:1809
dBRow_type & getDBRowReference(int index)
Definition: Database.cpp:767
::xml_schema::boolean addInsertTime_type
Definition: Database.h:1133
const xmlOverDB_optional & xmlOverDB() const
Definition: Database.cpp:1163
bool hasDbName() const
Definition: Database.cpp:899
void setNull(const null_type &x)
Definition: Database.cpp:275
::xml_schema::string dbHost_type
Definition: Database.h:877