1
2
3
4
5
6
7
8 package org.exolab.castor.mapping.xml;
9
10
11
12
13
14
15
16
17 @SuppressWarnings("serial")
18 public class ClassMapping implements java.io.Serializable {
19
20
21
22
23
24
25
26
27
28
29
30 private java.lang.String _name;
31
32
33
34
35
36
37
38
39 private java.lang.Object _extends;
40
41
42
43
44
45
46 private java.lang.Object _depends;
47
48
49
50
51
52
53
54 private java.util.List<java.lang.String> _identity;
55
56
57
58
59 private org.exolab.castor.mapping.xml.types.ClassMappingAccessType _access = org.exolab.castor.mapping.xml.types.ClassMappingAccessType.fromValue("shared");
60
61
62
63
64 private java.lang.String _keyGenerator;
65
66
67
68
69
70
71
72
73
74 private boolean _autoComplete = false;
75
76
77
78
79 private boolean _has_autoComplete;
80
81
82
83
84 private boolean _verifyConstructable = true;
85
86
87
88
89 private boolean _has_verifyConstructable;
90
91
92
93
94
95
96
97
98 private java.lang.String _version;
99
100
101
102
103 private java.lang.String _description;
104
105
106
107
108 private org.exolab.castor.mapping.xml.CacheTypeMapping _cacheTypeMapping;
109
110
111
112
113
114
115
116 private org.exolab.castor.mapping.xml.MapTo _mapTo;
117
118
119
120
121 private java.util.List<org.exolab.castor.mapping.xml.NamedQuery> _namedQueryList;
122
123
124
125
126 private java.util.List<org.exolab.castor.mapping.xml.NamedNativeQuery> _namedNativeQueryList;
127
128
129
130
131 private org.exolab.castor.mapping.xml.ClassChoice _classChoice;
132
133
134
135
136
137
138 public ClassMapping() {
139 super();
140 this._identity = new java.util.ArrayList<java.lang.String>();
141 setAccess(org.exolab.castor.mapping.xml.types.ClassMappingAccessType.fromValue("shared"));
142 this._namedQueryList = new java.util.ArrayList<org.exolab.castor.mapping.xml.NamedQuery>();
143 this._namedNativeQueryList = new java.util.ArrayList<org.exolab.castor.mapping.xml.NamedNativeQuery>();
144 }
145
146
147
148
149
150
151
152
153
154
155
156
157
158 public void addIdentity(
159 final java.lang.String vIdentity)
160 throws java.lang.IndexOutOfBoundsException {
161 this._identity.add(vIdentity);
162 }
163
164
165
166
167
168
169
170
171
172 public void addIdentity(
173 final int index,
174 final java.lang.String vIdentity)
175 throws java.lang.IndexOutOfBoundsException {
176 this._identity.add(index, vIdentity);
177 }
178
179
180
181
182
183
184
185
186 public void addNamedNativeQuery(
187 final org.exolab.castor.mapping.xml.NamedNativeQuery vNamedNativeQuery)
188 throws java.lang.IndexOutOfBoundsException {
189 this._namedNativeQueryList.add(vNamedNativeQuery);
190 }
191
192
193
194
195
196
197
198
199
200 public void addNamedNativeQuery(
201 final int index,
202 final org.exolab.castor.mapping.xml.NamedNativeQuery vNamedNativeQuery)
203 throws java.lang.IndexOutOfBoundsException {
204 this._namedNativeQueryList.add(index, vNamedNativeQuery);
205 }
206
207
208
209
210
211
212
213
214 public void addNamedQuery(
215 final org.exolab.castor.mapping.xml.NamedQuery vNamedQuery)
216 throws java.lang.IndexOutOfBoundsException {
217 this._namedQueryList.add(vNamedQuery);
218 }
219
220
221
222
223
224
225
226
227
228 public void addNamedQuery(
229 final int index,
230 final org.exolab.castor.mapping.xml.NamedQuery vNamedQuery)
231 throws java.lang.IndexOutOfBoundsException {
232 this._namedQueryList.add(index, vNamedQuery);
233 }
234
235
236
237 public void deleteAutoComplete(
238 ) {
239 this._has_autoComplete= false;
240 }
241
242
243
244 public void deleteVerifyConstructable(
245 ) {
246 this._has_verifyConstructable= false;
247 }
248
249
250
251
252
253
254
255 public java.util.Enumeration<? extends java.lang.String> enumerateIdentity(
256 ) {
257 return java.util.Collections.enumeration(this._identity);
258 }
259
260
261
262
263
264
265
266 public java.util.Enumeration<? extends org.exolab.castor.mapping.xml.NamedNativeQuery> enumerateNamedNativeQuery(
267 ) {
268 return java.util.Collections.enumeration(this._namedNativeQueryList);
269 }
270
271
272
273
274
275
276
277 public java.util.Enumeration<? extends org.exolab.castor.mapping.xml.NamedQuery> enumerateNamedQuery(
278 ) {
279 return java.util.Collections.enumeration(this._namedQueryList);
280 }
281
282
283
284
285
286
287 public org.exolab.castor.mapping.xml.types.ClassMappingAccessType getAccess(
288 ) {
289 return this._access;
290 }
291
292
293
294
295
296
297
298
299
300
301
302
303 public boolean getAutoComplete(
304 ) {
305 return this._autoComplete;
306 }
307
308
309
310
311
312
313 public org.exolab.castor.mapping.xml.CacheTypeMapping getCacheTypeMapping(
314 ) {
315 return this._cacheTypeMapping;
316 }
317
318
319
320
321
322
323 public org.exolab.castor.mapping.xml.ClassChoice getClassChoice(
324 ) {
325 return this._classChoice;
326 }
327
328
329
330
331
332
333
334
335
336
337 public java.lang.Object getDepends(
338 ) {
339 return this._depends;
340 }
341
342
343
344
345
346
347 public java.lang.String getDescription(
348 ) {
349 return this._description;
350 }
351
352
353
354
355
356
357
358
359
360
361
362
363 public java.lang.Object getExtends(
364 ) {
365 return this._extends;
366 }
367
368
369
370
371
372
373
374
375
376 public java.lang.String getIdentity(
377 final int index)
378 throws java.lang.IndexOutOfBoundsException {
379
380 if (index < 0 || index >= this._identity.size()) {
381 throw new IndexOutOfBoundsException("getIdentity: Index value '" + index + "' not in range [0.." + (this._identity.size() - 1) + "]");
382 }
383
384 return (java.lang.String) _identity.get(index);
385 }
386
387
388
389
390
391
392
393
394
395
396 public java.lang.String[] getIdentity(
397 ) {
398 java.lang.String[] array = new java.lang.String[0];
399 return (java.lang.String[]) this._identity.toArray(array);
400 }
401
402
403
404
405
406
407 public int getIdentityCount(
408 ) {
409 return this._identity.size();
410 }
411
412
413
414
415
416
417 public java.lang.String getKeyGenerator(
418 ) {
419 return this._keyGenerator;
420 }
421
422
423
424
425
426
427
428
429
430
431 public org.exolab.castor.mapping.xml.MapTo getMapTo(
432 ) {
433 return this._mapTo;
434 }
435
436
437
438
439
440
441
442
443
444 public java.lang.String getName(
445 ) {
446 return this._name;
447 }
448
449
450
451
452
453
454
455
456
457
458
459 public org.exolab.castor.mapping.xml.NamedNativeQuery getNamedNativeQuery(
460 final int index)
461 throws java.lang.IndexOutOfBoundsException {
462
463 if (index < 0 || index >= this._namedNativeQueryList.size()) {
464 throw new IndexOutOfBoundsException("getNamedNativeQuery: Index value '" + index + "' not in range [0.." + (this._namedNativeQueryList.size() - 1) + "]");
465 }
466
467 return (org.exolab.castor.mapping.xml.NamedNativeQuery) _namedNativeQueryList.get(index);
468 }
469
470
471
472
473
474
475
476
477
478
479
480 public org.exolab.castor.mapping.xml.NamedNativeQuery[] getNamedNativeQuery(
481 ) {
482 org.exolab.castor.mapping.xml.NamedNativeQuery[] array = new org.exolab.castor.mapping.xml.NamedNativeQuery[0];
483 return (org.exolab.castor.mapping.xml.NamedNativeQuery[]) this._namedNativeQueryList.toArray(array);
484 }
485
486
487
488
489
490
491 public int getNamedNativeQueryCount(
492 ) {
493 return this._namedNativeQueryList.size();
494 }
495
496
497
498
499
500
501
502
503
504
505 public org.exolab.castor.mapping.xml.NamedQuery getNamedQuery(
506 final int index)
507 throws java.lang.IndexOutOfBoundsException {
508
509 if (index < 0 || index >= this._namedQueryList.size()) {
510 throw new IndexOutOfBoundsException("getNamedQuery: Index value '" + index + "' not in range [0.." + (this._namedQueryList.size() - 1) + "]");
511 }
512
513 return (org.exolab.castor.mapping.xml.NamedQuery) _namedQueryList.get(index);
514 }
515
516
517
518
519
520
521
522
523
524
525 public org.exolab.castor.mapping.xml.NamedQuery[] getNamedQuery(
526 ) {
527 org.exolab.castor.mapping.xml.NamedQuery[] array = new org.exolab.castor.mapping.xml.NamedQuery[0];
528 return (org.exolab.castor.mapping.xml.NamedQuery[]) this._namedQueryList.toArray(array);
529 }
530
531
532
533
534
535
536 public int getNamedQueryCount(
537 ) {
538 return this._namedQueryList.size();
539 }
540
541
542
543
544
545
546 public boolean getVerifyConstructable(
547 ) {
548 return this._verifyConstructable;
549 }
550
551
552
553
554
555
556
557
558
559
560
561 public java.lang.String getVersion(
562 ) {
563 return this._version;
564 }
565
566
567
568
569
570
571 public boolean hasAutoComplete(
572 ) {
573 return this._has_autoComplete;
574 }
575
576
577
578
579
580
581
582 public boolean hasVerifyConstructable(
583 ) {
584 return this._has_verifyConstructable;
585 }
586
587
588
589
590
591
592
593
594
595
596
597
598 public boolean isAutoComplete(
599 ) {
600 return this._autoComplete;
601 }
602
603
604
605
606
607
608 public boolean isValid(
609 ) {
610 try {
611 validate();
612 } catch (org.exolab.castor.xml.ValidationException vex) {
613 return false;
614 }
615 return true;
616 }
617
618
619
620
621
622
623 public boolean isVerifyConstructable(
624 ) {
625 return this._verifyConstructable;
626 }
627
628
629
630
631
632
633
634 public java.util.Iterator<? extends java.lang.String> iterateIdentity(
635 ) {
636 return this._identity.iterator();
637 }
638
639
640
641
642
643
644
645 public java.util.Iterator<? extends org.exolab.castor.mapping.xml.NamedNativeQuery> iterateNamedNativeQuery(
646 ) {
647 return this._namedNativeQueryList.iterator();
648 }
649
650
651
652
653
654
655
656 public java.util.Iterator<? extends org.exolab.castor.mapping.xml.NamedQuery> iterateNamedQuery(
657 ) {
658 return this._namedQueryList.iterator();
659 }
660
661
662
663
664
665
666
667
668
669
670 public void marshal(
671 final java.io.Writer out)
672 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
673 org.exolab.castor.xml.Marshaller.marshal(this, out);
674 }
675
676
677
678
679
680
681
682
683
684
685
686
687 public void marshal(
688 final org.xml.sax.ContentHandler handler)
689 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
690 org.exolab.castor.xml.Marshaller.marshal(this, handler);
691 }
692
693
694
695 public void removeAllIdentity(
696 ) {
697 this._identity.clear();
698 }
699
700
701
702 public void removeAllNamedNativeQuery(
703 ) {
704 this._namedNativeQueryList.clear();
705 }
706
707
708
709 public void removeAllNamedQuery(
710 ) {
711 this._namedQueryList.clear();
712 }
713
714
715
716
717
718
719
720 public boolean removeIdentity(
721 final java.lang.String vIdentity) {
722 boolean removed = _identity.remove(vIdentity);
723 return removed;
724 }
725
726
727
728
729
730
731
732 public java.lang.String removeIdentityAt(
733 final int index) {
734 java.lang.Object obj = this._identity.remove(index);
735 return (java.lang.String) obj;
736 }
737
738
739
740
741
742
743
744 public boolean removeNamedNativeQuery(
745 final org.exolab.castor.mapping.xml.NamedNativeQuery vNamedNativeQuery) {
746 boolean removed = _namedNativeQueryList.remove(vNamedNativeQuery);
747 return removed;
748 }
749
750
751
752
753
754
755
756 public org.exolab.castor.mapping.xml.NamedNativeQuery removeNamedNativeQueryAt(
757 final int index) {
758 java.lang.Object obj = this._namedNativeQueryList.remove(index);
759 return (org.exolab.castor.mapping.xml.NamedNativeQuery) obj;
760 }
761
762
763
764
765
766
767
768 public boolean removeNamedQuery(
769 final org.exolab.castor.mapping.xml.NamedQuery vNamedQuery) {
770 boolean removed = _namedQueryList.remove(vNamedQuery);
771 return removed;
772 }
773
774
775
776
777
778
779
780 public org.exolab.castor.mapping.xml.NamedQuery removeNamedQueryAt(
781 final int index) {
782 java.lang.Object obj = this._namedQueryList.remove(index);
783 return (org.exolab.castor.mapping.xml.NamedQuery) obj;
784 }
785
786
787
788
789
790
791 public void setAccess(
792 final org.exolab.castor.mapping.xml.types.ClassMappingAccessType access) {
793 this._access = access;
794 }
795
796
797
798
799
800
801
802
803
804
805
806
807 public void setAutoComplete(
808 final boolean autoComplete) {
809 this._autoComplete = autoComplete;
810 this._has_autoComplete = true;
811 }
812
813
814
815
816
817
818 public void setCacheTypeMapping(
819 final org.exolab.castor.mapping.xml.CacheTypeMapping cacheTypeMapping) {
820 this._cacheTypeMapping = cacheTypeMapping;
821 }
822
823
824
825
826
827
828 public void setClassChoice(
829 final org.exolab.castor.mapping.xml.ClassChoice classChoice) {
830 this._classChoice = classChoice;
831 }
832
833
834
835
836
837
838
839
840
841
842 public void setDepends(
843 final java.lang.Object depends) {
844 this._depends = depends;
845 }
846
847
848
849
850
851
852 public void setDescription(
853 final java.lang.String description) {
854 this._description = description;
855 }
856
857
858
859
860
861
862
863
864
865
866
867
868
869 public void setExtends(
870 final java.lang.Object _extends) {
871 this._extends = _extends;
872 }
873
874
875
876
877
878
879
880
881
882 public void setIdentity(
883 final int index,
884 final java.lang.String vIdentity)
885 throws java.lang.IndexOutOfBoundsException {
886
887 if (index < 0 || index >= this._identity.size()) {
888 throw new IndexOutOfBoundsException("setIdentity: Index value '" + index + "' not in range [0.." + (this._identity.size() - 1) + "]");
889 }
890
891 this._identity.set(index, vIdentity);
892 }
893
894
895
896
897
898
899 public void setIdentity(
900 final java.lang.String[] vIdentityArray) {
901
902 _identity.clear();
903
904 for (int i = 0; i < vIdentityArray.length; i++) {
905 this._identity.add(vIdentityArray[i]);
906 }
907 }
908
909
910
911
912
913
914 public void setKeyGenerator(
915 final java.lang.String keyGenerator) {
916 this._keyGenerator = keyGenerator;
917 }
918
919
920
921
922
923
924
925
926
927
928 public void setMapTo(
929 final org.exolab.castor.mapping.xml.MapTo mapTo) {
930 this._mapTo = mapTo;
931 }
932
933
934
935
936
937
938
939
940
941 public void setName(
942 final java.lang.String name) {
943 this._name = name;
944 }
945
946
947
948
949
950
951
952
953
954 public void setNamedNativeQuery(
955 final int index,
956 final org.exolab.castor.mapping.xml.NamedNativeQuery vNamedNativeQuery)
957 throws java.lang.IndexOutOfBoundsException {
958
959 if (index < 0 || index >= this._namedNativeQueryList.size()) {
960 throw new IndexOutOfBoundsException("setNamedNativeQuery: Index value '" + index + "' not in range [0.." + (this._namedNativeQueryList.size() - 1) + "]");
961 }
962
963 this._namedNativeQueryList.set(index, vNamedNativeQuery);
964 }
965
966
967
968
969
970
971 public void setNamedNativeQuery(
972 final org.exolab.castor.mapping.xml.NamedNativeQuery[] vNamedNativeQueryArray) {
973
974 _namedNativeQueryList.clear();
975
976 for (int i = 0; i < vNamedNativeQueryArray.length; i++) {
977 this._namedNativeQueryList.add(vNamedNativeQueryArray[i]);
978 }
979 }
980
981
982
983
984
985
986
987
988
989 public void setNamedQuery(
990 final int index,
991 final org.exolab.castor.mapping.xml.NamedQuery vNamedQuery)
992 throws java.lang.IndexOutOfBoundsException {
993
994 if (index < 0 || index >= this._namedQueryList.size()) {
995 throw new IndexOutOfBoundsException("setNamedQuery: Index value '" + index + "' not in range [0.." + (this._namedQueryList.size() - 1) + "]");
996 }
997
998 this._namedQueryList.set(index, vNamedQuery);
999 }
1000
1001
1002
1003
1004
1005
1006 public void setNamedQuery(
1007 final org.exolab.castor.mapping.xml.NamedQuery[] vNamedQueryArray) {
1008
1009 _namedQueryList.clear();
1010
1011 for (int i = 0; i < vNamedQueryArray.length; i++) {
1012 this._namedQueryList.add(vNamedQueryArray[i]);
1013 }
1014 }
1015
1016
1017
1018
1019
1020
1021
1022 public void setVerifyConstructable(
1023 final boolean verifyConstructable) {
1024 this._verifyConstructable = verifyConstructable;
1025 this._has_verifyConstructable = true;
1026 }
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038 public void setVersion(
1039 final java.lang.String version) {
1040 this._version = version;
1041 }
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054 public static org.exolab.castor.mapping.xml.ClassMapping unmarshal(
1055 final java.io.Reader reader)
1056 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
1057 return (org.exolab.castor.mapping.xml.ClassMapping) org.exolab.castor.xml.Unmarshaller.unmarshal(org.exolab.castor.mapping.xml.ClassMapping.class, reader);
1058 }
1059
1060
1061
1062
1063
1064
1065
1066 public void validate(
1067 )
1068 throws org.exolab.castor.xml.ValidationException {
1069 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
1070 validator.validate(this);
1071 }
1072
1073 }