1
2
3
4
5 package org.andromda.cartridges.ejb.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.ClassifierFacade;
13 import org.andromda.metafacades.uml.ConstraintFacade;
14 import org.andromda.metafacades.uml.DependencyFacade;
15 import org.andromda.metafacades.uml.EntityQueryOperation;
16 import org.andromda.metafacades.uml.ModelElementFacade;
17 import org.andromda.metafacades.uml.ModelFacade;
18 import org.andromda.metafacades.uml.OperationFacade;
19 import org.andromda.metafacades.uml.PackageFacade;
20 import org.andromda.metafacades.uml.ParameterFacade;
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
27
28
29
30
31
32
33 public abstract class EJBFinderMethodFacadeLogic
34 extends MetafacadeBase
35 implements EJBFinderMethodFacade
36 {
37
38
39
40
41 protected Object metaObject;
42
43
44
45
46
47 protected EJBFinderMethodFacadeLogic(Object metaObjectIn, String context)
48 {
49 super(metaObjectIn, getContext(context));
50 this.superEntityQueryOperation =
51 (EntityQueryOperation)
52 MetafacadeFactory.getInstance().createFacadeImpl(
53 "org.andromda.metafacades.uml.EntityQueryOperation",
54 metaObjectIn,
55 getContext(context));
56 this.metaObject = metaObjectIn;
57 }
58
59
60
61
62
63
64 private static String getContext(String context)
65 {
66 if (context == null)
67 {
68 context = "org.andromda.cartridges.ejb.metafacades.EJBFinderMethodFacade";
69 }
70 return context;
71 }
72
73 private EntityQueryOperation superEntityQueryOperation;
74 private boolean superEntityQueryOperationInitialized = false;
75
76
77
78
79
80 private EntityQueryOperation getSuperEntityQueryOperation()
81 {
82 if (!this.superEntityQueryOperationInitialized)
83 {
84 ((MetafacadeBase)this.superEntityQueryOperation).setMetafacadeContext(this.getMetafacadeContext());
85 this.superEntityQueryOperationInitialized = true;
86 }
87 return this.superEntityQueryOperation;
88 }
89
90
91
92
93
94 @Override
95 public void resetMetafacadeContext(String context)
96 {
97 if (!this.contextRoot)
98 {
99 context = getContext(context);
100 setMetafacadeContext (context);
101 if (this.superEntityQueryOperationInitialized)
102 {
103 ((MetafacadeBase)this.superEntityQueryOperation).resetMetafacadeContext(context);
104 }
105 }
106 }
107
108
109
110
111
112 public boolean isEJBFinderMethodFacadeMetaType()
113 {
114 return true;
115 }
116
117
118
119
120
121
122
123 protected abstract String handleGetQuery();
124
125 private String __query1a;
126 private boolean __query1aSet = false;
127
128
129
130
131
132 public final String getQuery()
133 {
134 String query1a = this.__query1a;
135 if (!this.__query1aSet)
136 {
137
138 query1a = handleGetQuery();
139
140 this.__query1a = query1a;
141 if (isMetafacadePropertyCachingEnabled())
142 {
143 this.__query1aSet = true;
144 }
145 }
146 return query1a;
147 }
148
149
150
151
152
153 protected abstract String handleGetTransactionType();
154
155 private String __transactionType2a;
156 private boolean __transactionType2aSet = false;
157
158
159
160
161
162 public final String getTransactionType()
163 {
164 String transactionType2a = this.__transactionType2a;
165 if (!this.__transactionType2aSet)
166 {
167
168 transactionType2a = handleGetTransactionType();
169
170 this.__transactionType2a = transactionType2a;
171 if (isMetafacadePropertyCachingEnabled())
172 {
173 this.__transactionType2aSet = true;
174 }
175 }
176 return transactionType2a;
177 }
178
179
180
181
182
183 public boolean isEntityQueryOperationMetaType()
184 {
185 return true;
186 }
187
188
189
190
191
192 public boolean isOperationFacadeMetaType()
193 {
194 return true;
195 }
196
197
198
199
200
201 public boolean isModelElementFacadeMetaType()
202 {
203 return true;
204 }
205
206
207
208
209
210
211
212
213 public String getQuery(String translation)
214 {
215 return this.getSuperEntityQueryOperation().getQuery(translation);
216 }
217
218
219
220
221
222 public void copyTaggedValues(ModelElementFacade element)
223 {
224 this.getSuperEntityQueryOperation().copyTaggedValues(element);
225 }
226
227
228
229
230
231
232 public Object findTaggedValue(String tagName)
233 {
234 return this.getSuperEntityQueryOperation().findTaggedValue(tagName);
235 }
236
237
238
239
240
241
242 public Collection<Object> findTaggedValues(String tagName)
243 {
244 return this.getSuperEntityQueryOperation().findTaggedValues(tagName);
245 }
246
247
248
249
250
251
252
253 public String getBindedFullyQualifiedName(ModelElementFacade bindedElement)
254 {
255 return this.getSuperEntityQueryOperation().getBindedFullyQualifiedName(bindedElement);
256 }
257
258
259
260
261
262 public Collection<ConstraintFacade> getConstraints()
263 {
264 return this.getSuperEntityQueryOperation().getConstraints();
265 }
266
267
268
269
270
271
272 public Collection<ConstraintFacade> getConstraints(String kind)
273 {
274 return this.getSuperEntityQueryOperation().getConstraints(kind);
275 }
276
277
278
279
280
281
282
283 public String getDocumentation(String indent)
284 {
285 return this.getSuperEntityQueryOperation().getDocumentation(indent);
286 }
287
288
289
290
291
292
293
294
295 public String getDocumentation(String indent, int lineLength)
296 {
297 return this.getSuperEntityQueryOperation().getDocumentation(indent, lineLength);
298 }
299
300
301
302
303
304
305
306 public String getDocumentation(String indent, int lineLength, boolean htmlStyle)
307 {
308 return this.getSuperEntityQueryOperation().getDocumentation(indent, lineLength, htmlStyle);
309 }
310
311
312
313
314
315 public String getFullyQualifiedName()
316 {
317 return this.getSuperEntityQueryOperation().getFullyQualifiedName();
318 }
319
320
321
322
323
324
325
326
327 public String getFullyQualifiedName(boolean modelName)
328 {
329 return this.getSuperEntityQueryOperation().getFullyQualifiedName(modelName);
330 }
331
332
333
334
335
336
337 public String getFullyQualifiedNamePath()
338 {
339 return this.getSuperEntityQueryOperation().getFullyQualifiedNamePath();
340 }
341
342
343
344
345
346 public String getId()
347 {
348 return this.getSuperEntityQueryOperation().getId();
349 }
350
351
352
353
354
355
356
357
358
359 public Collection<String> getKeywords()
360 {
361 return this.getSuperEntityQueryOperation().getKeywords();
362 }
363
364
365
366
367
368 public String getLabel()
369 {
370 return this.getSuperEntityQueryOperation().getLabel();
371 }
372
373
374
375
376
377 public TypeMappings getLanguageMappings()
378 {
379 return this.getSuperEntityQueryOperation().getLanguageMappings();
380 }
381
382
383
384
385
386
387 public ModelFacade getModel()
388 {
389 return this.getSuperEntityQueryOperation().getModel();
390 }
391
392
393
394
395
396 public String getName()
397 {
398 return this.getSuperEntityQueryOperation().getName();
399 }
400
401
402
403
404
405 public ModelElementFacade getPackage()
406 {
407 return this.getSuperEntityQueryOperation().getPackage();
408 }
409
410
411
412
413
414 public String getPackageName()
415 {
416 return this.getSuperEntityQueryOperation().getPackageName();
417 }
418
419
420
421
422
423
424 public String getPackageName(boolean modelName)
425 {
426 return this.getSuperEntityQueryOperation().getPackageName(modelName);
427 }
428
429
430
431
432
433 public String getPackagePath()
434 {
435 return this.getSuperEntityQueryOperation().getPackagePath();
436 }
437
438
439
440
441
442
443
444
445 public String getQualifiedName()
446 {
447 return this.getSuperEntityQueryOperation().getQualifiedName();
448 }
449
450
451
452
453
454 public PackageFacade getRootPackage()
455 {
456 return this.getSuperEntityQueryOperation().getRootPackage();
457 }
458
459
460
461
462
463 public Collection<DependencyFacade> getSourceDependencies()
464 {
465 return this.getSuperEntityQueryOperation().getSourceDependencies();
466 }
467
468
469
470
471
472
473 public StateMachineFacade getStateMachineContext()
474 {
475 return this.getSuperEntityQueryOperation().getStateMachineContext();
476 }
477
478
479
480
481
482 public Collection<String> getStereotypeNames()
483 {
484 return this.getSuperEntityQueryOperation().getStereotypeNames();
485 }
486
487
488
489
490
491 public Collection<StereotypeFacade> getStereotypes()
492 {
493 return this.getSuperEntityQueryOperation().getStereotypes();
494 }
495
496
497
498
499
500 public Collection<TaggedValueFacade> getTaggedValues()
501 {
502 return this.getSuperEntityQueryOperation().getTaggedValues();
503 }
504
505
506
507
508
509 public Collection<DependencyFacade> getTargetDependencies()
510 {
511 return this.getSuperEntityQueryOperation().getTargetDependencies();
512 }
513
514
515
516
517
518 public Object getTemplateParameter(String parameterName)
519 {
520 return this.getSuperEntityQueryOperation().getTemplateParameter(parameterName);
521 }
522
523
524
525
526
527 public Collection<TemplateParameterFacade> getTemplateParameters()
528 {
529 return this.getSuperEntityQueryOperation().getTemplateParameters();
530 }
531
532
533
534
535
536
537 public String getVisibility()
538 {
539 return this.getSuperEntityQueryOperation().getVisibility();
540 }
541
542
543
544
545
546
547 public boolean hasExactStereotype(String stereotypeName)
548 {
549 return this.getSuperEntityQueryOperation().hasExactStereotype(stereotypeName);
550 }
551
552
553
554
555
556
557 public boolean hasKeyword(String keywordName)
558 {
559 return this.getSuperEntityQueryOperation().hasKeyword(keywordName);
560 }
561
562
563
564
565
566
567
568
569
570
571
572
573
574 public boolean hasStereotype(String stereotypeName)
575 {
576 return this.getSuperEntityQueryOperation().hasStereotype(stereotypeName);
577 }
578
579
580
581
582
583
584 public boolean isBindingDependenciesPresent()
585 {
586 return this.getSuperEntityQueryOperation().isBindingDependenciesPresent();
587 }
588
589
590
591
592
593 public boolean isConstraintsPresent()
594 {
595 return this.getSuperEntityQueryOperation().isConstraintsPresent();
596 }
597
598
599
600
601
602 public boolean isDocumentationPresent()
603 {
604 return this.getSuperEntityQueryOperation().isDocumentationPresent();
605 }
606
607
608
609
610
611 public boolean isReservedWord()
612 {
613 return this.getSuperEntityQueryOperation().isReservedWord();
614 }
615
616
617
618
619
620
621 public boolean isTemplateParametersPresent()
622 {
623 return this.getSuperEntityQueryOperation().isTemplateParametersPresent();
624 }
625
626
627
628
629
630
631
632 public boolean isValidIdentifierName()
633 {
634 return this.getSuperEntityQueryOperation().isValidIdentifierName();
635 }
636
637
638
639
640
641
642
643 public String translateConstraint(String name, String translation)
644 {
645 return this.getSuperEntityQueryOperation().translateConstraint(name, translation);
646 }
647
648
649
650
651
652 public String[] translateConstraints(String translation)
653 {
654 return this.getSuperEntityQueryOperation().translateConstraints(translation);
655 }
656
657
658
659
660
661 public String[] translateConstraints(String kind, String translation)
662 {
663 return this.getSuperEntityQueryOperation().translateConstraints(kind, translation);
664 }
665
666
667
668
669
670
671 public ParameterFacade findParameter(String name)
672 {
673 return this.getSuperEntityQueryOperation().findParameter(name);
674 }
675
676
677
678
679
680
681
682 public Object findTaggedValue(String name, boolean follow)
683 {
684 return this.getSuperEntityQueryOperation().findTaggedValue(name, follow);
685 }
686
687
688
689
690
691 public String getArgumentNames()
692 {
693 return this.getSuperEntityQueryOperation().getArgumentNames();
694 }
695
696
697
698
699
700 public String getArgumentTypeNames()
701 {
702 return this.getSuperEntityQueryOperation().getArgumentTypeNames();
703 }
704
705
706
707
708
709
710
711
712
713 public Collection<ParameterFacade> getArguments()
714 {
715 return this.getSuperEntityQueryOperation().getArguments();
716 }
717
718
719
720
721
722 public String getCall()
723 {
724 return this.getSuperEntityQueryOperation().getCall();
725 }
726
727
728
729
730
731
732
733 public String getConcurrency()
734 {
735 return this.getSuperEntityQueryOperation().getConcurrency();
736 }
737
738
739
740
741
742
743 public String getExceptionList()
744 {
745 return this.getSuperEntityQueryOperation().getExceptionList();
746 }
747
748
749
750
751
752
753 public String getExceptionList(String initialExceptions)
754 {
755 return this.getSuperEntityQueryOperation().getExceptionList(initialExceptions);
756 }
757
758
759
760
761
762 public Collection<ModelElementFacade> getExceptions()
763 {
764 return this.getSuperEntityQueryOperation().getExceptions();
765 }
766
767
768
769
770
771 public String getGetterSetterReturnTypeName()
772 {
773 return this.getSuperEntityQueryOperation().getGetterSetterReturnTypeName();
774 }
775
776
777
778
779
780
781 public int getLower()
782 {
783 return this.getSuperEntityQueryOperation().getLower();
784 }
785
786
787
788
789
790 public String getMethodBody()
791 {
792 return this.getSuperEntityQueryOperation().getMethodBody();
793 }
794
795
796
797
798
799 public OperationFacade getOverriddenOperation()
800 {
801 return this.getSuperEntityQueryOperation().getOverriddenOperation();
802 }
803
804
805
806
807
808 public ClassifierFacade getOwner()
809 {
810 return this.getSuperEntityQueryOperation().getOwner();
811 }
812
813
814
815
816
817 public Collection<ParameterFacade> getParameters()
818 {
819 return this.getSuperEntityQueryOperation().getParameters();
820 }
821
822
823
824
825
826 public String getPostconditionName()
827 {
828 return this.getSuperEntityQueryOperation().getPostconditionName();
829 }
830
831
832
833
834
835 public Collection<ConstraintFacade> getPostconditions()
836 {
837 return this.getSuperEntityQueryOperation().getPostconditions();
838 }
839
840
841
842
843
844 public String getPreconditionCall()
845 {
846 return this.getSuperEntityQueryOperation().getPreconditionCall();
847 }
848
849
850
851
852
853 public String getPreconditionName()
854 {
855 return this.getSuperEntityQueryOperation().getPreconditionName();
856 }
857
858
859
860
861
862 public String getPreconditionSignature()
863 {
864 return this.getSuperEntityQueryOperation().getPreconditionSignature();
865 }
866
867
868
869
870
871 public Collection<ConstraintFacade> getPreconditions()
872 {
873 return this.getSuperEntityQueryOperation().getPreconditions();
874 }
875
876
877
878
879
880 public ParameterFacade getReturnParameter()
881 {
882 return this.getSuperEntityQueryOperation().getReturnParameter();
883 }
884
885
886
887
888
889 public ClassifierFacade getReturnType()
890 {
891 return this.getSuperEntityQueryOperation().getReturnType();
892 }
893
894
895
896
897
898
899 public String getSignature()
900 {
901 return this.getSuperEntityQueryOperation().getSignature();
902 }
903
904
905
906
907
908
909
910 public String getSignature(boolean withArgumentNames)
911 {
912 return this.getSuperEntityQueryOperation().getSignature(withArgumentNames);
913 }
914
915
916
917
918
919
920 public String getSignature(String argumentModifier)
921 {
922 return this.getSuperEntityQueryOperation().getSignature(argumentModifier);
923 }
924
925
926
927
928
929 public String getTypedArgumentList()
930 {
931 return this.getSuperEntityQueryOperation().getTypedArgumentList();
932 }
933
934
935
936
937
938
939 public String getTypedArgumentList(String modifier)
940 {
941 return this.getSuperEntityQueryOperation().getTypedArgumentList(modifier);
942 }
943
944
945
946
947
948
949 public int getUpper()
950 {
951 return this.getSuperEntityQueryOperation().getUpper();
952 }
953
954
955
956
957
958 public boolean isAbstract()
959 {
960 return this.getSuperEntityQueryOperation().isAbstract();
961 }
962
963
964
965
966
967 public boolean isExceptionsPresent()
968 {
969 return this.getSuperEntityQueryOperation().isExceptionsPresent();
970 }
971
972
973
974
975
976
977 public boolean isLeaf()
978 {
979 return this.getSuperEntityQueryOperation().isLeaf();
980 }
981
982
983
984
985
986
987 public boolean isMany()
988 {
989 return this.getSuperEntityQueryOperation().isMany();
990 }
991
992
993
994
995
996
997 public boolean isOrdered()
998 {
999 return this.getSuperEntityQueryOperation().isOrdered();
1000 }
1001
1002
1003
1004
1005
1006
1007
1008 public boolean isOverriding()
1009 {
1010 return this.getSuperEntityQueryOperation().isOverriding();
1011 }
1012
1013
1014
1015
1016
1017 public boolean isPostconditionsPresent()
1018 {
1019 return this.getSuperEntityQueryOperation().isPostconditionsPresent();
1020 }
1021
1022
1023
1024
1025
1026 public boolean isPreconditionsPresent()
1027 {
1028 return this.getSuperEntityQueryOperation().isPreconditionsPresent();
1029 }
1030
1031
1032
1033
1034
1035 public boolean isQuery()
1036 {
1037 return this.getSuperEntityQueryOperation().isQuery();
1038 }
1039
1040
1041
1042
1043
1044
1045 public boolean isReturnTypePresent()
1046 {
1047 return this.getSuperEntityQueryOperation().isReturnTypePresent();
1048 }
1049
1050
1051
1052
1053
1054 public boolean isStatic()
1055 {
1056 return this.getSuperEntityQueryOperation().isStatic();
1057 }
1058
1059
1060
1061
1062
1063
1064 public boolean isUnique()
1065 {
1066 return this.getSuperEntityQueryOperation().isUnique();
1067 }
1068
1069
1070
1071
1072 @Override
1073 public void initialize()
1074 {
1075 this.getSuperEntityQueryOperation().initialize();
1076 }
1077
1078
1079
1080
1081
1082 @Override
1083 public Object getValidationOwner()
1084 {
1085 Object owner = this.getSuperEntityQueryOperation().getValidationOwner();
1086 return owner;
1087 }
1088
1089
1090
1091
1092
1093 @Override
1094 public String getValidationName()
1095 {
1096 String name = this.getSuperEntityQueryOperation().getValidationName();
1097 return name;
1098 }
1099
1100
1101
1102
1103
1104 @Override
1105 public void validateInvariants(Collection<ModelValidationMessage> validationMessages)
1106 {
1107 this.getSuperEntityQueryOperation().validateInvariants(validationMessages);
1108 }
1109
1110
1111
1112
1113 private static final String NAME_PROPERTY = "name";
1114 private static final String FQNAME_PROPERTY = "fullyQualifiedName";
1115
1116
1117
1118
1119 @Override
1120 public String toString()
1121 {
1122 final StringBuilder toString = new StringBuilder(this.getClass().getName());
1123 toString.append("[");
1124 try
1125 {
1126 toString.append(Introspector.instance().getProperty(this, FQNAME_PROPERTY));
1127 }
1128 catch (final Throwable tryAgain)
1129 {
1130 try
1131 {
1132 toString.append(Introspector.instance().getProperty(this, NAME_PROPERTY));
1133 }
1134 catch (final Throwable ignore)
1135 {
1136
1137 }
1138 }
1139 toString.append("]");
1140 return toString.toString();
1141 }
1142 }