1
2
3
4
5
6
7
8 package org.exolab.castor.mapping.xml;
9
10
11
12
13
14
15
16
17
18 @SuppressWarnings("serial")
19 public class Sql implements java.io.Serializable {
20
21
22
23
24
25
26
27
28
29
30
31
32 private java.util.List<java.lang.String> _name;
33
34
35
36
37
38
39 private java.lang.String _type;
40
41
42
43
44
45
46
47
48
49 private java.lang.String _manyTable;
50
51
52
53
54
55
56
57
58
59 private java.util.List<java.lang.String> _manyKey;
60
61
62
63
64
65
66
67
68
69
70
71 private java.lang.String _cascading;
72
73
74
75
76 private boolean _readOnly = false;
77
78
79
80
81 private boolean _has_readOnly;
82
83
84
85
86 private boolean _transient;
87
88
89
90
91 private boolean _has_transient;
92
93
94
95
96 private org.exolab.castor.mapping.xml.types.SqlDirtyType _dirty = org.exolab.castor.mapping.xml.types.SqlDirtyType.fromValue("check");
97
98
99
100
101
102
103 public Sql() {
104 super();
105 this._name = new java.util.ArrayList<java.lang.String>();
106 this._manyKey = new java.util.ArrayList<java.lang.String>();
107 setDirty(org.exolab.castor.mapping.xml.types.SqlDirtyType.fromValue("check"));
108 }
109
110
111
112
113
114
115
116
117
118
119
120
121
122 public void addManyKey(
123 final java.lang.String vManyKey)
124 throws java.lang.IndexOutOfBoundsException {
125 this._manyKey.add(vManyKey);
126 }
127
128
129
130
131
132
133
134
135
136 public void addManyKey(
137 final int index,
138 final java.lang.String vManyKey)
139 throws java.lang.IndexOutOfBoundsException {
140 this._manyKey.add(index, vManyKey);
141 }
142
143
144
145
146
147
148
149
150 public void addName(
151 final java.lang.String vName)
152 throws java.lang.IndexOutOfBoundsException {
153 this._name.add(vName);
154 }
155
156
157
158
159
160
161
162
163
164 public void addName(
165 final int index,
166 final java.lang.String vName)
167 throws java.lang.IndexOutOfBoundsException {
168 this._name.add(index, vName);
169 }
170
171
172
173 public void deleteReadOnly(
174 ) {
175 this._has_readOnly= false;
176 }
177
178
179
180 public void deleteTransient(
181 ) {
182 this._has_transient= false;
183 }
184
185
186
187
188
189
190
191 public java.util.Enumeration<? extends java.lang.String> enumerateManyKey(
192 ) {
193 return java.util.Collections.enumeration(this._manyKey);
194 }
195
196
197
198
199
200
201
202 public java.util.Enumeration<? extends java.lang.String> enumerateName(
203 ) {
204 return java.util.Collections.enumeration(this._name);
205 }
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220 public java.lang.String getCascading(
221 ) {
222 return this._cascading;
223 }
224
225
226
227
228
229
230 public org.exolab.castor.mapping.xml.types.SqlDirtyType getDirty(
231 ) {
232 return this._dirty;
233 }
234
235
236
237
238
239
240
241
242
243 public java.lang.String getManyKey(
244 final int index)
245 throws java.lang.IndexOutOfBoundsException {
246
247 if (index < 0 || index >= this._manyKey.size()) {
248 throw new IndexOutOfBoundsException("getManyKey: Index value '" + index + "' not in range [0.." + (this._manyKey.size() - 1) + "]");
249 }
250
251 return (java.lang.String) _manyKey.get(index);
252 }
253
254
255
256
257
258
259
260
261
262
263 public java.lang.String[] getManyKey(
264 ) {
265 java.lang.String[] array = new java.lang.String[0];
266 return (java.lang.String[]) this._manyKey.toArray(array);
267 }
268
269
270
271
272
273
274 public int getManyKeyCount(
275 ) {
276 return this._manyKey.size();
277 }
278
279
280
281
282
283
284
285
286
287
288
289
290 public java.lang.String getManyTable(
291 ) {
292 return this._manyTable;
293 }
294
295
296
297
298
299
300
301
302
303 public java.lang.String getName(
304 final int index)
305 throws java.lang.IndexOutOfBoundsException {
306
307 if (index < 0 || index >= this._name.size()) {
308 throw new IndexOutOfBoundsException("getName: Index value '" + index + "' not in range [0.." + (this._name.size() - 1) + "]");
309 }
310
311 return (java.lang.String) _name.get(index);
312 }
313
314
315
316
317
318
319
320
321
322
323 public java.lang.String[] getName(
324 ) {
325 java.lang.String[] array = new java.lang.String[0];
326 return (java.lang.String[]) this._name.toArray(array);
327 }
328
329
330
331
332
333
334 public int getNameCount(
335 ) {
336 return this._name.size();
337 }
338
339
340
341
342
343
344 public boolean getReadOnly(
345 ) {
346 return this._readOnly;
347 }
348
349
350
351
352
353
354 public boolean getTransient(
355 ) {
356 return this._transient;
357 }
358
359
360
361
362
363
364
365
366
367 public java.lang.String getType(
368 ) {
369 return this._type;
370 }
371
372
373
374
375
376
377 public boolean hasReadOnly(
378 ) {
379 return this._has_readOnly;
380 }
381
382
383
384
385
386
387 public boolean hasTransient(
388 ) {
389 return this._has_transient;
390 }
391
392
393
394
395
396
397 public boolean isReadOnly(
398 ) {
399 return this._readOnly;
400 }
401
402
403
404
405
406
407 public boolean isTransient(
408 ) {
409 return this._transient;
410 }
411
412
413
414
415
416
417 public boolean isValid(
418 ) {
419 try {
420 validate();
421 } catch (org.exolab.castor.xml.ValidationException vex) {
422 return false;
423 }
424 return true;
425 }
426
427
428
429
430
431
432
433 public java.util.Iterator<? extends java.lang.String> iterateManyKey(
434 ) {
435 return this._manyKey.iterator();
436 }
437
438
439
440
441
442
443
444 public java.util.Iterator<? extends java.lang.String> iterateName(
445 ) {
446 return this._name.iterator();
447 }
448
449
450
451
452
453
454
455
456
457
458 public void marshal(
459 final java.io.Writer out)
460 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
461 org.exolab.castor.xml.Marshaller.marshal(this, out);
462 }
463
464
465
466
467
468
469
470
471
472
473
474
475 public void marshal(
476 final org.xml.sax.ContentHandler handler)
477 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
478 org.exolab.castor.xml.Marshaller.marshal(this, handler);
479 }
480
481
482
483 public void removeAllManyKey(
484 ) {
485 this._manyKey.clear();
486 }
487
488
489
490 public void removeAllName(
491 ) {
492 this._name.clear();
493 }
494
495
496
497
498
499
500
501 public boolean removeManyKey(
502 final java.lang.String vManyKey) {
503 boolean removed = _manyKey.remove(vManyKey);
504 return removed;
505 }
506
507
508
509
510
511
512
513 public java.lang.String removeManyKeyAt(
514 final int index) {
515 java.lang.Object obj = this._manyKey.remove(index);
516 return (java.lang.String) obj;
517 }
518
519
520
521
522
523
524
525 public boolean removeName(
526 final java.lang.String vName) {
527 boolean removed = _name.remove(vName);
528 return removed;
529 }
530
531
532
533
534
535
536
537 public java.lang.String removeNameAt(
538 final int index) {
539 java.lang.Object obj = this._name.remove(index);
540 return (java.lang.String) obj;
541 }
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556 public void setCascading(
557 final java.lang.String cascading) {
558 this._cascading = cascading;
559 }
560
561
562
563
564
565
566 public void setDirty(
567 final org.exolab.castor.mapping.xml.types.SqlDirtyType dirty) {
568 this._dirty = dirty;
569 }
570
571
572
573
574
575
576
577
578
579 public void setManyKey(
580 final int index,
581 final java.lang.String vManyKey)
582 throws java.lang.IndexOutOfBoundsException {
583
584 if (index < 0 || index >= this._manyKey.size()) {
585 throw new IndexOutOfBoundsException("setManyKey: Index value '" + index + "' not in range [0.." + (this._manyKey.size() - 1) + "]");
586 }
587
588 this._manyKey.set(index, vManyKey);
589 }
590
591
592
593
594
595
596 public void setManyKey(
597 final java.lang.String[] vManyKeyArray) {
598
599 _manyKey.clear();
600
601 for (int i = 0; i < vManyKeyArray.length; i++) {
602 this._manyKey.add(vManyKeyArray[i]);
603 }
604 }
605
606
607
608
609
610
611
612
613
614
615
616
617 public void setManyTable(
618 final java.lang.String manyTable) {
619 this._manyTable = manyTable;
620 }
621
622
623
624
625
626
627
628
629
630 public void setName(
631 final int index,
632 final java.lang.String vName)
633 throws java.lang.IndexOutOfBoundsException {
634
635 if (index < 0 || index >= this._name.size()) {
636 throw new IndexOutOfBoundsException("setName: Index value '" + index + "' not in range [0.." + (this._name.size() - 1) + "]");
637 }
638
639 this._name.set(index, vName);
640 }
641
642
643
644
645
646
647 public void setName(
648 final java.lang.String[] vNameArray) {
649
650 _name.clear();
651
652 for (int i = 0; i < vNameArray.length; i++) {
653 this._name.add(vNameArray[i]);
654 }
655 }
656
657
658
659
660
661
662 public void setReadOnly(
663 final boolean readOnly) {
664 this._readOnly = readOnly;
665 this._has_readOnly = true;
666 }
667
668
669
670
671
672
673
674 public void setTransient(
675 final boolean _transient) {
676 this._transient = _transient;
677 this._has_transient = true;
678 }
679
680
681
682
683
684
685
686
687
688 public void setType(
689 final java.lang.String type) {
690 this._type = type;
691 }
692
693
694
695
696
697
698
699
700
701
702
703 public static org.exolab.castor.mapping.xml.Sql unmarshal(
704 final java.io.Reader reader)
705 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
706 return (org.exolab.castor.mapping.xml.Sql) org.exolab.castor.xml.Unmarshaller.unmarshal(org.exolab.castor.mapping.xml.Sql.class, reader);
707 }
708
709
710
711
712
713
714
715 public void validate(
716 )
717 throws org.exolab.castor.xml.ValidationException {
718 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
719 validator.validate(this);
720 }
721
722 }