1
2
3
4
5 package org.andromda.cartridges.hibernate.metafacades;
6
7 import java.util.Collection;
8 import org.andromda.core.common.Introspector;
9 import org.andromda.core.metafacade.MetafacadeBase;
10 import org.andromda.core.metafacade.MetafacadeFactory;
11 import org.andromda.core.metafacade.ModelValidationMessage;
12 import org.andromda.metafacades.uml.AssociationEndFacade;
13 import org.andromda.metafacades.uml.AssociationFacade;
14 import org.andromda.metafacades.uml.ClassifierFacade;
15 import org.andromda.metafacades.uml.ConstraintFacade;
16 import org.andromda.metafacades.uml.DependencyFacade;
17 import org.andromda.metafacades.uml.EntityAssociationEnd;
18 import org.andromda.metafacades.uml.ModelElementFacade;
19 import org.andromda.metafacades.uml.ModelFacade;
20 import org.andromda.metafacades.uml.PackageFacade;
21 import org.andromda.metafacades.uml.StateMachineFacade;
22 import org.andromda.metafacades.uml.StereotypeFacade;
23 import org.andromda.metafacades.uml.TaggedValueFacade;
24 import org.andromda.metafacades.uml.TemplateParameterFacade;
25 import org.andromda.metafacades.uml.TypeMappings;
26 import org.andromda.translation.ocl.validation.OCLCollections;
27 import org.andromda.translation.ocl.validation.OCLIntrospector;
28 import org.andromda.translation.ocl.validation.OCLResultEnsurer;
29 import org.apache.log4j.Logger;
30
31
32
33
34
35
36
37 public abstract class HibernateAssociationEndLogic
38 extends MetafacadeBase
39 implements HibernateAssociationEnd
40 {
41
42
43
44
45 protected Object metaObject;
46
47
48
49
50
51 protected HibernateAssociationEndLogic(Object metaObjectIn, String context)
52 {
53 super(metaObjectIn, getContext(context));
54 this.superEntityAssociationEnd =
55 (EntityAssociationEnd)
56 MetafacadeFactory.getInstance().createFacadeImpl(
57 "org.andromda.metafacades.uml.EntityAssociationEnd",
58 metaObjectIn,
59 getContext(context));
60 this.metaObject = metaObjectIn;
61 }
62
63
64
65
66 private static final Logger logger = Logger.getLogger(HibernateAssociationEndLogic.class);
67
68
69
70
71
72
73 private static String getContext(String context)
74 {
75 if (context == null)
76 {
77 context = "org.andromda.cartridges.hibernate.metafacades.HibernateAssociationEnd";
78 }
79 return context;
80 }
81
82 private EntityAssociationEnd superEntityAssociationEnd;
83 private boolean superEntityAssociationEndInitialized = false;
84
85
86
87
88
89 private EntityAssociationEnd getSuperEntityAssociationEnd()
90 {
91 if (!this.superEntityAssociationEndInitialized)
92 {
93 ((MetafacadeBase)this.superEntityAssociationEnd).setMetafacadeContext(this.getMetafacadeContext());
94 this.superEntityAssociationEndInitialized = true;
95 }
96 return this.superEntityAssociationEnd;
97 }
98
99
100
101
102
103 @Override
104 public void resetMetafacadeContext(String context)
105 {
106 if (!this.contextRoot)
107 {
108 context = getContext(context);
109 setMetafacadeContext (context);
110 if (this.superEntityAssociationEndInitialized)
111 {
112 ((MetafacadeBase)this.superEntityAssociationEnd).resetMetafacadeContext(context);
113 }
114 }
115 }
116
117
118
119
120
121 public boolean isHibernateAssociationEndMetaType()
122 {
123 return true;
124 }
125
126
127
128
129
130
131
132 protected abstract boolean handleIsLazy();
133
134 private boolean __lazy1a;
135 private boolean __lazy1aSet = false;
136
137
138
139
140
141
142 public final boolean isLazy()
143 {
144 boolean lazy1a = this.__lazy1a;
145 if (!this.__lazy1aSet)
146 {
147
148 lazy1a = handleIsLazy();
149
150 this.__lazy1a = lazy1a;
151 if (isMetafacadePropertyCachingEnabled())
152 {
153 this.__lazy1aSet = true;
154 }
155 }
156 return lazy1a;
157 }
158
159
160
161
162
163 protected abstract String handleGetOuterJoin();
164
165 private String __outerJoin2a;
166 private boolean __outerJoin2aSet = false;
167
168
169
170
171
172
173 public final String getOuterJoin()
174 {
175 String outerJoin2a = this.__outerJoin2a;
176 if (!this.__outerJoin2aSet)
177 {
178
179 outerJoin2a = handleGetOuterJoin();
180
181 this.__outerJoin2a = outerJoin2a;
182 if (isMetafacadePropertyCachingEnabled())
183 {
184 this.__outerJoin2aSet = true;
185 }
186 }
187 return outerJoin2a;
188 }
189
190
191
192
193
194 protected abstract boolean handleIsHibernateInverse();
195
196 private boolean __hibernateInverse3a;
197 private boolean __hibernateInverse3aSet = false;
198
199
200
201
202
203 public final boolean isHibernateInverse()
204 {
205 boolean hibernateInverse3a = this.__hibernateInverse3a;
206 if (!this.__hibernateInverse3aSet)
207 {
208
209 hibernateInverse3a = handleIsHibernateInverse();
210
211 this.__hibernateInverse3a = hibernateInverse3a;
212 if (isMetafacadePropertyCachingEnabled())
213 {
214 this.__hibernateInverse3aSet = true;
215 }
216 }
217 return hibernateInverse3a;
218 }
219
220
221
222
223
224 protected abstract String handleGetHibernateCascade();
225
226 private String __hibernateCascade4a;
227 private boolean __hibernateCascade4aSet = false;
228
229
230
231
232
233 public final String getHibernateCascade()
234 {
235 String hibernateCascade4a = this.__hibernateCascade4a;
236 if (!this.__hibernateCascade4aSet)
237 {
238
239 hibernateCascade4a = handleGetHibernateCascade();
240
241 this.__hibernateCascade4a = hibernateCascade4a;
242 if (isMetafacadePropertyCachingEnabled())
243 {
244 this.__hibernateCascade4aSet = true;
245 }
246 }
247 return hibernateCascade4a;
248 }
249
250
251
252
253
254 protected abstract boolean handleIsOne2OnePrimary();
255
256 private boolean __one2OnePrimary5a;
257 private boolean __one2OnePrimary5aSet = false;
258
259
260
261
262
263
264
265
266
267
268 public final boolean isOne2OnePrimary()
269 {
270 boolean one2OnePrimary5a = this.__one2OnePrimary5a;
271 if (!this.__one2OnePrimary5aSet)
272 {
273
274 one2OnePrimary5a = handleIsOne2OnePrimary();
275
276 this.__one2OnePrimary5a = one2OnePrimary5a;
277 if (isMetafacadePropertyCachingEnabled())
278 {
279 this.__one2OnePrimary5aSet = true;
280 }
281 }
282 return one2OnePrimary5a;
283 }
284
285
286
287
288
289 protected abstract String handleGetCollectionType();
290
291 private String __collectionType6a;
292 private boolean __collectionType6aSet = false;
293
294
295
296
297
298
299 public final String getCollectionType()
300 {
301 String collectionType6a = this.__collectionType6a;
302 if (!this.__collectionType6aSet)
303 {
304
305 collectionType6a = handleGetCollectionType();
306
307 this.__collectionType6a = collectionType6a;
308 if (isMetafacadePropertyCachingEnabled())
309 {
310 this.__collectionType6aSet = true;
311 }
312 }
313 return collectionType6a;
314 }
315
316
317
318
319
320 protected abstract String handleGetSortType();
321
322 private String __sortType7a;
323 private boolean __sortType7aSet = false;
324
325
326
327
328
329
330 public final String getSortType()
331 {
332 String sortType7a = this.__sortType7a;
333 if (!this.__sortType7aSet)
334 {
335
336 sortType7a = handleGetSortType();
337
338 this.__sortType7a = sortType7a;
339 if (isMetafacadePropertyCachingEnabled())
340 {
341 this.__sortType7aSet = true;
342 }
343 }
344 return sortType7a;
345 }
346
347
348
349
350
351 protected abstract String handleGetOrderByColumns();
352
353 private String __orderByColumns8a;
354 private boolean __orderByColumns8aSet = false;
355
356
357
358
359
360
361 public final String getOrderByColumns()
362 {
363 String orderByColumns8a = this.__orderByColumns8a;
364 if (!this.__orderByColumns8aSet)
365 {
366
367 orderByColumns8a = handleGetOrderByColumns();
368
369 this.__orderByColumns8a = orderByColumns8a;
370 if (isMetafacadePropertyCachingEnabled())
371 {
372 this.__orderByColumns8aSet = true;
373 }
374 }
375 return orderByColumns8a;
376 }
377
378
379
380
381
382 protected abstract String handleGetWhereClause();
383
384 private String __whereClause9a;
385 private boolean __whereClause9aSet = false;
386
387
388
389
390
391
392 public final String getWhereClause()
393 {
394 String whereClause9a = this.__whereClause9a;
395 if (!this.__whereClause9aSet)
396 {
397
398 whereClause9a = handleGetWhereClause();
399
400 this.__whereClause9a = whereClause9a;
401 if (isMetafacadePropertyCachingEnabled())
402 {
403 this.__whereClause9aSet = true;
404 }
405 }
406 return whereClause9a;
407 }
408
409
410
411
412
413 protected abstract boolean handleIsIndexedCollection();
414
415 private boolean __indexedCollection10a;
416 private boolean __indexedCollection10aSet = false;
417
418
419
420
421
422
423 public final boolean isIndexedCollection()
424 {
425 boolean indexedCollection10a = this.__indexedCollection10a;
426 if (!this.__indexedCollection10aSet)
427 {
428
429 indexedCollection10a = handleIsIndexedCollection();
430
431 this.__indexedCollection10a = indexedCollection10a;
432 if (isMetafacadePropertyCachingEnabled())
433 {
434 this.__indexedCollection10aSet = true;
435 }
436 }
437 return indexedCollection10a;
438 }
439
440
441
442
443
444 protected abstract String handleGetCollectionIndexName();
445
446 private String __collectionIndexName11a;
447 private boolean __collectionIndexName11aSet = false;
448
449
450
451
452
453
454 public final String getCollectionIndexName()
455 {
456 String collectionIndexName11a = this.__collectionIndexName11a;
457 if (!this.__collectionIndexName11aSet)
458 {
459
460 collectionIndexName11a = handleGetCollectionIndexName();
461
462 this.__collectionIndexName11a = collectionIndexName11a;
463 if (isMetafacadePropertyCachingEnabled())
464 {
465 this.__collectionIndexName11aSet = true;
466 }
467 }
468 return collectionIndexName11a;
469 }
470
471
472
473
474
475 protected abstract boolean handleIsMap();
476
477 private boolean __map12a;
478 private boolean __map12aSet = false;
479
480
481
482
483
484
485 public final boolean isMap()
486 {
487 boolean map12a = this.__map12a;
488 if (!this.__map12aSet)
489 {
490
491 map12a = handleIsMap();
492
493 this.__map12a = map12a;
494 if (isMetafacadePropertyCachingEnabled())
495 {
496 this.__map12aSet = true;
497 }
498 }
499 return map12a;
500 }
501
502
503
504
505
506 protected abstract boolean handleIsList();
507
508 private boolean __list13a;
509 private boolean __list13aSet = false;
510
511
512
513
514
515
516 public final boolean isList()
517 {
518 boolean list13a = this.__list13a;
519 if (!this.__list13aSet)
520 {
521
522 list13a = handleIsList();
523
524 this.__list13a = list13a;
525 if (isMetafacadePropertyCachingEnabled())
526 {
527 this.__list13aSet = true;
528 }
529 }
530 return list13a;
531 }
532
533
534
535
536
537 protected abstract boolean handleIsSet();
538
539 private boolean __set14a;
540 private boolean __set14aSet = false;
541
542
543
544
545
546
547 public final boolean isSet()
548 {
549 boolean set14a = this.__set14a;
550 if (!this.__set14aSet)
551 {
552
553 set14a = handleIsSet();
554
555 this.__set14a = set14a;
556 if (isMetafacadePropertyCachingEnabled())
557 {
558 this.__set14aSet = true;
559 }
560 }
561 return set14a;
562 }
563
564
565
566
567
568 protected abstract boolean handleIsBag();
569
570 private boolean __bag15a;
571 private boolean __bag15aSet = false;
572
573
574
575
576
577
578 public final boolean isBag()
579 {
580 boolean bag15a = this.__bag15a;
581 if (!this.__bag15aSet)
582 {
583
584 bag15a = handleIsBag();
585
586 this.__bag15a = bag15a;
587 if (isMetafacadePropertyCachingEnabled())
588 {
589 this.__bag15aSet = true;
590 }
591 }
592 return bag15a;
593 }
594
595
596
597
598
599 protected abstract String handleGetCollectionIndexType();
600
601 private String __collectionIndexType16a;
602 private boolean __collectionIndexType16aSet = false;
603
604
605
606
607
608
609 public final String getCollectionIndexType()
610 {
611 String collectionIndexType16a = this.__collectionIndexType16a;
612 if (!this.__collectionIndexType16aSet)
613 {
614
615 collectionIndexType16a = handleGetCollectionIndexType();
616
617 this.__collectionIndexType16a = collectionIndexType16a;
618 if (isMetafacadePropertyCachingEnabled())
619 {
620 this.__collectionIndexType16aSet = true;
621 }
622 }
623 return collectionIndexType16a;
624 }
625
626
627
628
629
630 protected abstract String handleGetCollectionTypeImplementation();
631
632 private String __collectionTypeImplementation17a;
633 private boolean __collectionTypeImplementation17aSet = false;
634
635
636
637
638
639 public final String getCollectionTypeImplementation()
640 {
641 String collectionTypeImplementation17a = this.__collectionTypeImplementation17a;
642 if (!this.__collectionTypeImplementation17aSet)
643 {
644
645 collectionTypeImplementation17a = handleGetCollectionTypeImplementation();
646
647 this.__collectionTypeImplementation17a = collectionTypeImplementation17a;
648 if (isMetafacadePropertyCachingEnabled())
649 {
650 this.__collectionTypeImplementation17aSet = true;
651 }
652 }
653 return collectionTypeImplementation17a;
654 }
655
656
657
658
659
660 protected abstract String handleGetHibernateAggregationCascade();
661
662 private String __hibernateAggregationCascade18a;
663 private boolean __hibernateAggregationCascade18aSet = false;
664
665
666
667
668
669 public final String getHibernateAggregationCascade()
670 {
671 String hibernateAggregationCascade18a = this.__hibernateAggregationCascade18a;
672 if (!this.__hibernateAggregationCascade18aSet)
673 {
674
675 hibernateAggregationCascade18a = handleGetHibernateAggregationCascade();
676
677 this.__hibernateAggregationCascade18a = hibernateAggregationCascade18a;
678 if (isMetafacadePropertyCachingEnabled())
679 {
680 this.__hibernateAggregationCascade18aSet = true;
681 }
682 }
683 return hibernateAggregationCascade18a;
684 }
685
686
687
688
689
690 protected abstract String handleGetHibernateCompositionCascade();
691
692 private String __hibernateCompositionCascade19a;
693 private boolean __hibernateCompositionCascade19aSet = false;
694
695
696
697
698
699 public final String getHibernateCompositionCascade()
700 {
701 String hibernateCompositionCascade19a = this.__hibernateCompositionCascade19a;
702 if (!this.__hibernateCompositionCascade19aSet)
703 {
704
705 hibernateCompositionCascade19a = handleGetHibernateCompositionCascade();
706
707 this.__hibernateCompositionCascade19a = hibernateCompositionCascade19a;
708 if (isMetafacadePropertyCachingEnabled())
709 {
710 this.__hibernateCompositionCascade19aSet = true;
711 }
712 }
713 return hibernateCompositionCascade19a;
714 }
715
716
717
718
719
720 protected abstract boolean handleIsBidirectionalOrderedListChild();
721
722 private boolean __bidirectionalOrderedListChild20a;
723 private boolean __bidirectionalOrderedListChild20aSet = false;
724
725
726
727
728
729
730 public final boolean isBidirectionalOrderedListChild()
731 {
732 boolean bidirectionalOrderedListChild20a = this.__bidirectionalOrderedListChild20a;
733 if (!this.__bidirectionalOrderedListChild20aSet)
734 {
735
736 bidirectionalOrderedListChild20a = handleIsBidirectionalOrderedListChild();
737
738 this.__bidirectionalOrderedListChild20a = bidirectionalOrderedListChild20a;
739 if (isMetafacadePropertyCachingEnabled())
740 {
741 this.__bidirectionalOrderedListChild20aSet = true;
742 }
743 }
744 return bidirectionalOrderedListChild20a;
745 }
746
747
748
749
750
751 protected abstract boolean handleIsBidirectionalOrderedListParent();
752
753 private boolean __bidirectionalOrderedListParent21a;
754 private boolean __bidirectionalOrderedListParent21aSet = false;
755
756
757
758
759
760
761 public final boolean isBidirectionalOrderedListParent()
762 {
763 boolean bidirectionalOrderedListParent21a = this.__bidirectionalOrderedListParent21a;
764 if (!this.__bidirectionalOrderedListParent21aSet)
765 {
766
767 bidirectionalOrderedListParent21a = handleIsBidirectionalOrderedListParent();
768
769 this.__bidirectionalOrderedListParent21a = bidirectionalOrderedListParent21a;
770 if (isMetafacadePropertyCachingEnabled())
771 {
772 this.__bidirectionalOrderedListParent21aSet = true;
773 }
774 }
775 return bidirectionalOrderedListParent21a;
776 }
777
778
779
780
781
782 protected abstract String handleGetEmbedXML();
783
784 private String __embedXML22a;
785 private boolean __embedXML22aSet = false;
786
787
788
789
790
791
792 public final String getEmbedXML()
793 {
794 String embedXML22a = this.__embedXML22a;
795 if (!this.__embedXML22aSet)
796 {
797
798 embedXML22a = handleGetEmbedXML();
799
800 this.__embedXML22a = embedXML22a;
801 if (isMetafacadePropertyCachingEnabled())
802 {
803 this.__embedXML22aSet = true;
804 }
805 }
806 return embedXML22a;
807 }
808
809
810
811
812
813 protected abstract String handleGetXmlTagName();
814
815 private String __xmlTagName23a;
816 private boolean __xmlTagName23aSet = false;
817
818
819
820
821
822
823 public final String getXmlTagName()
824 {
825 String xmlTagName23a = this.__xmlTagName23a;
826 if (!this.__xmlTagName23aSet)
827 {
828
829 xmlTagName23a = handleGetXmlTagName();
830
831 this.__xmlTagName23a = xmlTagName23a;
832 if (isMetafacadePropertyCachingEnabled())
833 {
834 this.__xmlTagName23aSet = true;
835 }
836 }
837 return xmlTagName23a;
838 }
839
840
841
842
843
844 protected abstract boolean handleIsOwning();
845
846 private boolean __owning24a;
847 private boolean __owning24aSet = false;
848
849
850
851
852
853
854 public final boolean isOwning()
855 {
856 boolean owning24a = this.__owning24a;
857 if (!this.__owning24aSet)
858 {
859
860 owning24a = handleIsOwning();
861
862 this.__owning24a = owning24a;
863 if (isMetafacadePropertyCachingEnabled())
864 {
865 this.__owning24aSet = true;
866 }
867 }
868 return owning24a;
869 }
870
871
872
873
874
875 public boolean isEntityAssociationEndMetaType()
876 {
877 return true;
878 }
879
880
881
882
883
884 public boolean isAssociationEndFacadeMetaType()
885 {
886 return true;
887 }
888
889
890
891
892
893 public boolean isModelElementFacadeMetaType()
894 {
895 return true;
896 }
897
898
899
900
901
902
903 public String getAdderName()
904 {
905 return this.getSuperEntityAssociationEnd().getAdderName();
906 }
907
908
909
910
911
912
913
914 public String getAggregationKind()
915 {
916 return this.getSuperEntityAssociationEnd().getAggregationKind();
917 }
918
919
920
921
922
923 public AssociationFacade getAssociation()
924 {
925 return this.getSuperEntityAssociationEnd().getAssociation();
926 }
927
928
929
930
931
932
933
934
935 public String getDefault()
936 {
937 return this.getSuperEntityAssociationEnd().getDefault();
938 }
939
940
941
942
943
944 public String getGetterName()
945 {
946 return this.getSuperEntityAssociationEnd().getGetterName();
947 }
948
949
950
951
952
953
954 public String getGetterSetterTypeName()
955 {
956 return this.getSuperEntityAssociationEnd().getGetterSetterTypeName();
957 }
958
959
960
961
962
963
964 public int getLower()
965 {
966 return this.getSuperEntityAssociationEnd().getLower();
967 }
968
969
970
971
972
973 public AssociationEndFacade getOtherEnd()
974 {
975 return this.getSuperEntityAssociationEnd().getOtherEnd();
976 }
977
978
979
980
981
982 public String getRemoverName()
983 {
984 return this.getSuperEntityAssociationEnd().getRemoverName();
985 }
986
987
988
989
990
991 public String getSetterName()
992 {
993 return this.getSuperEntityAssociationEnd().getSetterName();
994 }
995
996
997
998
999
1000 public ClassifierFacade getType()
1001 {
1002 return this.getSuperEntityAssociationEnd().getType();
1003 }
1004
1005
1006
1007
1008
1009
1010 public int getUpper()
1011 {
1012 return this.getSuperEntityAssociationEnd().getUpper();
1013 }
1014
1015
1016
1017
1018
1019 public boolean isAggregation()
1020 {
1021 return this.getSuperEntityAssociationEnd().isAggregation();
1022 }
1023
1024
1025
1026
1027
1028
1029 public boolean isBidirectional()
1030 {
1031 return this.getSuperEntityAssociationEnd().isBidirectional();
1032 }
1033
1034
1035
1036
1037
1038
1039 public boolean isChild()
1040 {
1041 return this.getSuperEntityAssociationEnd().isChild();
1042 }
1043
1044
1045
1046
1047
1048 public boolean isComposition()
1049 {
1050 return this.getSuperEntityAssociationEnd().isComposition();
1051 }
1052
1053
1054
1055
1056
1057
1058 public boolean isDerived()
1059 {
1060 return this.getSuperEntityAssociationEnd().isDerived();
1061 }
1062
1063
1064
1065
1066
1067
1068 public boolean isLeaf()
1069 {
1070 return this.getSuperEntityAssociationEnd().isLeaf();
1071 }
1072
1073
1074
1075
1076
1077 public boolean isMany()
1078 {
1079 return this.getSuperEntityAssociationEnd().isMany();
1080 }
1081
1082
1083
1084
1085
1086 public boolean isMany2Many()
1087 {
1088 return this.getSuperEntityAssociationEnd().isMany2Many();
1089 }
1090
1091
1092
1093
1094
1095 public boolean isMany2One()
1096 {
1097 return this.getSuperEntityAssociationEnd().isMany2One();
1098 }
1099
1100
1101
1102
1103
1104 public boolean isNavigable()
1105 {
1106 return this.getSuperEntityAssociationEnd().isNavigable();
1107 }
1108
1109
1110
1111
1112
1113 public boolean isOne2Many()
1114 {
1115 return this.getSuperEntityAssociationEnd().isOne2Many();
1116 }
1117
1118
1119
1120
1121
1122 public boolean isOne2One()
1123 {
1124 return this.getSuperEntityAssociationEnd().isOne2One();
1125 }
1126
1127
1128
1129
1130
1131
1132 public boolean isOrdered()
1133 {
1134 return this.getSuperEntityAssociationEnd().isOrdered();
1135 }
1136
1137
1138
1139
1140
1141 public boolean isReadOnly()
1142 {
1143 return this.getSuperEntityAssociationEnd().isReadOnly();
1144 }
1145
1146
1147
1148
1149
1150 public boolean isRequired()
1151 {
1152 return this.getSuperEntityAssociationEnd().isRequired();
1153 }
1154
1155
1156
1157
1158
1159 public boolean isStatic()
1160 {
1161 return this.getSuperEntityAssociationEnd().isStatic();
1162 }
1163
1164
1165
1166
1167
1168
1169 public boolean isUnique()
1170 {
1171 return this.getSuperEntityAssociationEnd().isUnique();
1172 }
1173
1174
1175
1176
1177
1178 public String getColumnIndex()
1179 {
1180 return this.getSuperEntityAssociationEnd().getColumnIndex();
1181 }
1182
1183
1184
1185
1186
1187 public String getColumnName()
1188 {
1189 return this.getSuperEntityAssociationEnd().getColumnName();
1190 }
1191
1192
1193
1194
1195
1196 public String getForeignKeyConstraintName()
1197 {
1198 return this.getSuperEntityAssociationEnd().getForeignKeyConstraintName();
1199 }
1200
1201
1202
1203
1204
1205 public String getForeignKeySuffix()
1206 {
1207 return this.getSuperEntityAssociationEnd().getForeignKeySuffix();
1208 }
1209
1210
1211
1212
1213
1214 public String getSqlType()
1215 {
1216 return this.getSuperEntityAssociationEnd().getSqlType();
1217 }
1218
1219
1220
1221
1222
1223 public String getUniqueGroup()
1224 {
1225 return this.getSuperEntityAssociationEnd().getUniqueGroup();
1226 }
1227
1228
1229
1230
1231
1232
1233
1234
1235 public boolean isForeignIdentifier()
1236 {
1237 return this.getSuperEntityAssociationEnd().isForeignIdentifier();
1238 }
1239
1240
1241
1242
1243
1244 public boolean isIdentifier()
1245 {
1246 return this.getSuperEntityAssociationEnd().isIdentifier();
1247 }
1248
1249
1250
1251
1252
1253 public boolean isIdentifiersPresent()
1254 {
1255 return this.getSuperEntityAssociationEnd().isIdentifiersPresent();
1256 }
1257
1258
1259
1260
1261
1262 public boolean isTransient()
1263 {
1264 return this.getSuperEntityAssociationEnd().isTransient();
1265 }
1266
1267
1268
1269
1270
1271 public void copyTaggedValues(ModelElementFacade element)
1272 {
1273 this.getSuperEntityAssociationEnd().copyTaggedValues(element);
1274 }
1275
1276
1277
1278
1279
1280
1281 public Object findTaggedValue(String tagName)
1282 {
1283 return this.getSuperEntityAssociationEnd().findTaggedValue(tagName);
1284 }
1285
1286
1287
1288
1289
1290
1291 public Collection<Object> findTaggedValues(String tagName)
1292 {
1293 return this.getSuperEntityAssociationEnd().findTaggedValues(tagName);
1294 }
1295
1296
1297
1298
1299
1300
1301
1302 public String getBindedFullyQualifiedName(ModelElementFacade bindedElement)
1303 {
1304 return this.getSuperEntityAssociationEnd().getBindedFullyQualifiedName(bindedElement);
1305 }
1306
1307
1308
1309
1310
1311 public Collection<ConstraintFacade> getConstraints()
1312 {
1313 return this.getSuperEntityAssociationEnd().getConstraints();
1314 }
1315
1316
1317
1318
1319
1320
1321 public Collection<ConstraintFacade> getConstraints(String kind)
1322 {
1323 return this.getSuperEntityAssociationEnd().getConstraints(kind);
1324 }
1325
1326
1327
1328
1329
1330
1331
1332 public String getDocumentation(String indent)
1333 {
1334 return this.getSuperEntityAssociationEnd().getDocumentation(indent);
1335 }
1336
1337
1338
1339
1340
1341
1342
1343
1344 public String getDocumentation(String indent, int lineLength)
1345 {
1346 return this.getSuperEntityAssociationEnd().getDocumentation(indent, lineLength);
1347 }
1348
1349
1350
1351
1352
1353
1354
1355 public String getDocumentation(String indent, int lineLength, boolean htmlStyle)
1356 {
1357 return this.getSuperEntityAssociationEnd().getDocumentation(indent, lineLength, htmlStyle);
1358 }
1359
1360
1361
1362
1363
1364 public String getFullyQualifiedName()
1365 {
1366 return this.getSuperEntityAssociationEnd().getFullyQualifiedName();
1367 }
1368
1369
1370
1371
1372
1373
1374
1375
1376 public String getFullyQualifiedName(boolean modelName)
1377 {
1378 return this.getSuperEntityAssociationEnd().getFullyQualifiedName(modelName);
1379 }
1380
1381
1382
1383
1384
1385
1386 public String getFullyQualifiedNamePath()
1387 {
1388 return this.getSuperEntityAssociationEnd().getFullyQualifiedNamePath();
1389 }
1390
1391
1392
1393
1394
1395 public String getId()
1396 {
1397 return this.getSuperEntityAssociationEnd().getId();
1398 }
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408 public Collection<String> getKeywords()
1409 {
1410 return this.getSuperEntityAssociationEnd().getKeywords();
1411 }
1412
1413
1414
1415
1416
1417 public String getLabel()
1418 {
1419 return this.getSuperEntityAssociationEnd().getLabel();
1420 }
1421
1422
1423
1424
1425
1426 public TypeMappings getLanguageMappings()
1427 {
1428 return this.getSuperEntityAssociationEnd().getLanguageMappings();
1429 }
1430
1431
1432
1433
1434
1435
1436 public ModelFacade getModel()
1437 {
1438 return this.getSuperEntityAssociationEnd().getModel();
1439 }
1440
1441
1442
1443
1444
1445 public String getName()
1446 {
1447 return this.getSuperEntityAssociationEnd().getName();
1448 }
1449
1450
1451
1452
1453
1454 public ModelElementFacade getPackage()
1455 {
1456 return this.getSuperEntityAssociationEnd().getPackage();
1457 }
1458
1459
1460
1461
1462
1463 public String getPackageName()
1464 {
1465 return this.getSuperEntityAssociationEnd().getPackageName();
1466 }
1467
1468
1469
1470
1471
1472
1473 public String getPackageName(boolean modelName)
1474 {
1475 return this.getSuperEntityAssociationEnd().getPackageName(modelName);
1476 }
1477
1478
1479
1480
1481
1482 public String getPackagePath()
1483 {
1484 return this.getSuperEntityAssociationEnd().getPackagePath();
1485 }
1486
1487
1488
1489
1490
1491
1492
1493
1494 public String getQualifiedName()
1495 {
1496 return this.getSuperEntityAssociationEnd().getQualifiedName();
1497 }
1498
1499
1500
1501
1502
1503 public PackageFacade getRootPackage()
1504 {
1505 return this.getSuperEntityAssociationEnd().getRootPackage();
1506 }
1507
1508
1509
1510
1511
1512 public Collection<DependencyFacade> getSourceDependencies()
1513 {
1514 return this.getSuperEntityAssociationEnd().getSourceDependencies();
1515 }
1516
1517
1518
1519
1520
1521
1522 public StateMachineFacade getStateMachineContext()
1523 {
1524 return this.getSuperEntityAssociationEnd().getStateMachineContext();
1525 }
1526
1527
1528
1529
1530
1531 public Collection<String> getStereotypeNames()
1532 {
1533 return this.getSuperEntityAssociationEnd().getStereotypeNames();
1534 }
1535
1536
1537
1538
1539
1540 public Collection<StereotypeFacade> getStereotypes()
1541 {
1542 return this.getSuperEntityAssociationEnd().getStereotypes();
1543 }
1544
1545
1546
1547
1548
1549 public Collection<TaggedValueFacade> getTaggedValues()
1550 {
1551 return this.getSuperEntityAssociationEnd().getTaggedValues();
1552 }
1553
1554
1555
1556
1557
1558 public Collection<DependencyFacade> getTargetDependencies()
1559 {
1560 return this.getSuperEntityAssociationEnd().getTargetDependencies();
1561 }
1562
1563
1564
1565
1566
1567 public Object getTemplateParameter(String parameterName)
1568 {
1569 return this.getSuperEntityAssociationEnd().getTemplateParameter(parameterName);
1570 }
1571
1572
1573
1574
1575
1576 public Collection<TemplateParameterFacade> getTemplateParameters()
1577 {
1578 return this.getSuperEntityAssociationEnd().getTemplateParameters();
1579 }
1580
1581
1582
1583
1584
1585
1586 public String getVisibility()
1587 {
1588 return this.getSuperEntityAssociationEnd().getVisibility();
1589 }
1590
1591
1592
1593
1594
1595
1596 public boolean hasExactStereotype(String stereotypeName)
1597 {
1598 return this.getSuperEntityAssociationEnd().hasExactStereotype(stereotypeName);
1599 }
1600
1601
1602
1603
1604
1605
1606 public boolean hasKeyword(String keywordName)
1607 {
1608 return this.getSuperEntityAssociationEnd().hasKeyword(keywordName);
1609 }
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623 public boolean hasStereotype(String stereotypeName)
1624 {
1625 return this.getSuperEntityAssociationEnd().hasStereotype(stereotypeName);
1626 }
1627
1628
1629
1630
1631
1632
1633 public boolean isBindingDependenciesPresent()
1634 {
1635 return this.getSuperEntityAssociationEnd().isBindingDependenciesPresent();
1636 }
1637
1638
1639
1640
1641
1642 public boolean isConstraintsPresent()
1643 {
1644 return this.getSuperEntityAssociationEnd().isConstraintsPresent();
1645 }
1646
1647
1648
1649
1650
1651 public boolean isDocumentationPresent()
1652 {
1653 return this.getSuperEntityAssociationEnd().isDocumentationPresent();
1654 }
1655
1656
1657
1658
1659
1660 public boolean isReservedWord()
1661 {
1662 return this.getSuperEntityAssociationEnd().isReservedWord();
1663 }
1664
1665
1666
1667
1668
1669
1670 public boolean isTemplateParametersPresent()
1671 {
1672 return this.getSuperEntityAssociationEnd().isTemplateParametersPresent();
1673 }
1674
1675
1676
1677
1678
1679
1680
1681 public boolean isValidIdentifierName()
1682 {
1683 return this.getSuperEntityAssociationEnd().isValidIdentifierName();
1684 }
1685
1686
1687
1688
1689
1690
1691
1692 public String translateConstraint(String name, String translation)
1693 {
1694 return this.getSuperEntityAssociationEnd().translateConstraint(name, translation);
1695 }
1696
1697
1698
1699
1700
1701 public String[] translateConstraints(String translation)
1702 {
1703 return this.getSuperEntityAssociationEnd().translateConstraints(translation);
1704 }
1705
1706
1707
1708
1709
1710 public String[] translateConstraints(String kind, String translation)
1711 {
1712 return this.getSuperEntityAssociationEnd().translateConstraints(kind, translation);
1713 }
1714
1715
1716
1717
1718 @Override
1719 public void initialize()
1720 {
1721 this.getSuperEntityAssociationEnd().initialize();
1722 }
1723
1724
1725
1726
1727
1728 @Override
1729 public Object getValidationOwner()
1730 {
1731 Object owner = this.getSuperEntityAssociationEnd().getValidationOwner();
1732 return owner;
1733 }
1734
1735
1736
1737
1738
1739 @Override
1740 public String getValidationName()
1741 {
1742 String name = this.getSuperEntityAssociationEnd().getValidationName();
1743 return name;
1744 }
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763 @Override
1764 public void validateInvariants(Collection<ModelValidationMessage> validationMessages)
1765 {
1766 this.getSuperEntityAssociationEnd().validateInvariants(validationMessages);
1767 try
1768 {
1769 final Object contextElement = this.THIS();
1770 boolean constraintValid = OCLResultEnsurer.ensure((Boolean.valueOf(String.valueOf(OCLIntrospector.invoke(contextElement,"otherEnd.type") instanceof HibernateEntity&&Boolean.valueOf(String.valueOf(OCLIntrospector.invoke(contextElement,"one2One"))).booleanValue())).booleanValue()?(Boolean.valueOf(String.valueOf(OCLIntrospector.invoke(contextElement,"one2OnePrimary"))).booleanValue()||Boolean.valueOf(String.valueOf(OCLIntrospector.invoke(contextElement,"otherEnd.one2OnePrimary"))).booleanValue()):true));
1771 if (!constraintValid)
1772 {
1773 validationMessages.add(
1774 new ModelValidationMessage(
1775 (MetafacadeBase)contextElement ,
1776 "org::andromda::cartridges::hibernate::metafacades::HibernateAssociationEnd::one-to-one associations must have aggregation on one side",
1777 "One-to-one associations must either have one side flagged as primary (using andromda_persistence_associationEnd_primary) or have one side of the association indicating aggregation (aggregation defines the parent owning entity)"));
1778 }
1779 }
1780 catch (Throwable th)
1781 {
1782 Throwable cause = th.getCause();
1783 int depth = 0;
1784 while (cause != null && depth < 7)
1785 {
1786 th = cause;
1787 depth++;
1788 }
1789 logger.error("Error validating constraint 'org::andromda::cartridges::hibernate::metafacades::HibernateAssociationEnd::one-to-one associations must have aggregation on one side' ON "
1790 + this.THIS().toString() + ": " + th.getMessage(), th);
1791 }
1792 try
1793 {
1794 final Object contextElement = this.THIS();
1795 boolean constraintValid = OCLResultEnsurer.ensure((Boolean.valueOf(String.valueOf(OCLIntrospector.invoke(contextElement,"otherEnd.type") instanceof HibernateEntity&&Boolean.valueOf(String.valueOf(OCLIntrospector.invoke(contextElement,"otherEnd.list"))).booleanValue())).booleanValue()?OCLCollections.notEmpty(OCLIntrospector.invoke(contextElement,"otherEnd.collectionIndexName")):true));
1796 if (!constraintValid)
1797 {
1798 validationMessages.add(
1799 new ModelValidationMessage(
1800 (MetafacadeBase)contextElement ,
1801 "org::andromda::cartridges::hibernate::metafacades::HibernateAssociationEnd::ordered collections must have an index defined",
1802 "Ordered collections (i.e. lists) must have an index defined. You can define this with either the associationEndCollectionIndexName (to apply to all ordered collections in your model(s)), or andromda_hibernate_collection_index\nto apply to a single ordered collection."));
1803 }
1804 }
1805 catch (Throwable th)
1806 {
1807 Throwable cause = th.getCause();
1808 int depth = 0;
1809 while (cause != null && depth < 7)
1810 {
1811 th = cause;
1812 depth++;
1813 }
1814 logger.error("Error validating constraint 'org::andromda::cartridges::hibernate::metafacades::HibernateAssociationEnd::ordered collections must have an index defined' ON "
1815 + this.THIS().toString() + ": " + th.getMessage(), th);
1816 }
1817 try
1818 {
1819 final Object contextElement = this.THIS();
1820 boolean constraintValid = OCLResultEnsurer.ensure((Boolean.valueOf(String.valueOf(OCLIntrospector.invoke(contextElement,"otherEnd.type") instanceof HibernateEntity&&Boolean.valueOf(String.valueOf(OCLIntrospector.invoke(contextElement,"otherEnd.map"))).booleanValue())).booleanValue()?(OCLCollections.notEmpty(OCLIntrospector.invoke(contextElement,"otherEnd.collectionIndexType"))&&OCLCollections.notEmpty(OCLIntrospector.invoke(contextElement,"otherEnd.collectionIndexName"))):true));
1821 if (!constraintValid)
1822 {
1823 validationMessages.add(
1824 new ModelValidationMessage(
1825 (MetafacadeBase)contextElement ,
1826 "org::andromda::cartridges::hibernate::metafacades::HibernateAssociationEnd::map collecions must have the index type defined.",
1827 "Collections defined as maps must have an index and index type defined., you can define each with the associationEndCollectionIndexName and associationEndCollectionIndexType (to apply to all mapped collections in your model(s)), or andromda_hibernate_collection_index and andromda_hibernate_collection_index_type\nto apply to a single ordered collection."));
1828 }
1829 }
1830 catch (Throwable th)
1831 {
1832 Throwable cause = th.getCause();
1833 int depth = 0;
1834 while (cause != null && depth < 7)
1835 {
1836 th = cause;
1837 depth++;
1838 }
1839 logger.error("Error validating constraint 'org::andromda::cartridges::hibernate::metafacades::HibernateAssociationEnd::map collecions must have the index type defined.' ON "
1840 + this.THIS().toString() + ": " + th.getMessage(), th);
1841 }
1842 }
1843
1844
1845
1846
1847 private static final String NAME_PROPERTY = "name";
1848 private static final String FQNAME_PROPERTY = "fullyQualifiedName";
1849
1850
1851
1852
1853 @Override
1854 public String toString()
1855 {
1856 final StringBuilder toString = new StringBuilder(this.getClass().getName());
1857 toString.append("[");
1858 try
1859 {
1860 toString.append(Introspector.instance().getProperty(this, FQNAME_PROPERTY));
1861 }
1862 catch (final Throwable tryAgain)
1863 {
1864 try
1865 {
1866 toString.append(Introspector.instance().getProperty(this, NAME_PROPERTY));
1867 }
1868 catch (final Throwable ignore)
1869 {
1870
1871 }
1872 }
1873 toString.append("]");
1874 return toString.toString();
1875 }
1876 }