1 // license-header java merge-point
2 //
3 // Attention: generated code (by MetafacadeLogic.vsl) - do not modify!
4 //
5 package org.andromda.cartridges.ejb3.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
27 /**
28 * Represents an EJB association end.
29 * MetafacadeLogic for EJB3AssociationEndFacade
30 *
31 * @see EJB3AssociationEndFacade
32 */
33 public abstract class EJB3AssociationEndFacadeLogic
34 extends MetafacadeBase
35 implements EJB3AssociationEndFacade
36 {
37 /**
38 * The underlying UML object
39 * @see Object
40 */
41 protected Object metaObject;
42
43 /** Create Metafacade implementation instance using the MetafacadeFactory from the context
44 * @param metaObjectIn
45 * @param context
46 */
47 protected EJB3AssociationEndFacadeLogic(Object metaObjectIn, String context)
48 {
49 super(metaObjectIn, getContext(context));
50 this.superEntityAssociationEnd =
51 (EntityAssociationEnd)
52 MetafacadeFactory.getInstance().createFacadeImpl(
53 "org.andromda.metafacades.uml.EntityAssociationEnd",
54 metaObjectIn,
55 getContext(context));
56 this.metaObject = metaObjectIn;
57 }
58
59 /**
60 * Gets the context for this metafacade logic instance.
61 * @param context String. Set to EJB3AssociationEndFacade if null
62 * @return context String
63 */
64 private static String getContext(String context)
65 {
66 if (context == null)
67 {
68 context = "org.andromda.cartridges.ejb3.metafacades.EJB3AssociationEndFacade";
69 }
70 return context;
71 }
72
73 private EntityAssociationEnd superEntityAssociationEnd;
74 private boolean superEntityAssociationEndInitialized = false;
75
76 /**
77 * Gets the EntityAssociationEnd parent instance.
78 * @return this.superEntityAssociationEnd EntityAssociationEnd
79 */
80 private EntityAssociationEnd getSuperEntityAssociationEnd()
81 {
82 if (!this.superEntityAssociationEndInitialized)
83 {
84 ((MetafacadeBase)this.superEntityAssociationEnd).setMetafacadeContext(this.getMetafacadeContext());
85 this.superEntityAssociationEndInitialized = true;
86 }
87 return this.superEntityAssociationEnd;
88 }
89
90 /** Reset context only for non-root metafacades
91 * @param context
92 * @see org.andromda.core.metafacade.MetafacadeBase#resetMetafacadeContext(String context)
93 */
94 @Override
95 public void resetMetafacadeContext(String context)
96 {
97 if (!this.contextRoot) // reset context only for non-root metafacades
98 {
99 context = getContext(context); // to have same value as in original constructor call
100 setMetafacadeContext (context);
101 if (this.superEntityAssociationEndInitialized)
102 {
103 ((MetafacadeBase)this.superEntityAssociationEnd).resetMetafacadeContext(context);
104 }
105 }
106 }
107
108 /**
109 * @return boolean true always
110 * @see EJB3AssociationEndFacade
111 */
112 public boolean isEJB3AssociationEndFacadeMetaType()
113 {
114 return true;
115 }
116
117 // --------------- attributes ---------------------
118
119 /**
120 * @see org.andromda.cartridges.ejb3.metafacades.EJB3AssociationEndFacade#getFetchType()
121 * @return String
122 */
123 protected abstract String handleGetFetchType();
124
125 private String __fetchType1a;
126 private boolean __fetchType1aSet = false;
127
128 /**
129 * Get the fetch type for this association end(CMR).
130 * If no fetch type tagged value is specified and COMPOSITION_DEFINES_EAGER_LOADING is enabled,
131 * then:
132 * <ul><li>aggregation: lazy-loaded</li><li>composition: eager-loaded</li></ul>
133 * Otherwise, the default fetch type for CMR of type One2Many and Many2Many is LAZY.
134 * Default fetch type for CMR of type Many2One and One2One is EAGER.
135 * This will return either EAGER or LAZY.
136 * @return (String)handleGetFetchType()
137 */
138 public final String getFetchType()
139 {
140 String fetchType1a = this.__fetchType1a;
141 if (!this.__fetchType1aSet)
142 {
143 // fetchType has no pre constraints
144 fetchType1a = handleGetFetchType();
145 // fetchType has no post constraints
146 this.__fetchType1a = fetchType1a;
147 if (isMetafacadePropertyCachingEnabled())
148 {
149 this.__fetchType1aSet = true;
150 }
151 }
152 return fetchType1a;
153 }
154
155 /**
156 * @see org.andromda.cartridges.ejb3.metafacades.EJB3AssociationEndFacade#isOwning()
157 * @return boolean
158 */
159 protected abstract boolean handleIsOwning();
160
161 private boolean __owning2a;
162 private boolean __owning2aSet = false;
163
164 /**
165 * Determines if this association end if the owning side. Used in one-to-one and many-to-many
166 * relationships.
167 * @return (boolean)handleIsOwning()
168 */
169 public final boolean isOwning()
170 {
171 boolean owning2a = this.__owning2a;
172 if (!this.__owning2aSet)
173 {
174 // owning has no pre constraints
175 owning2a = handleIsOwning();
176 // owning has no post constraints
177 this.__owning2a = owning2a;
178 if (isMetafacadePropertyCachingEnabled())
179 {
180 this.__owning2aSet = true;
181 }
182 }
183 return owning2a;
184 }
185
186 /**
187 * @see org.andromda.cartridges.ejb3.metafacades.EJB3AssociationEndFacade#isOptional()
188 * @return boolean
189 */
190 protected abstract boolean handleIsOptional();
191
192 private boolean __optional3a;
193 private boolean __optional3aSet = false;
194
195 /**
196 * Sets the optional attribute on the annotation to determine if a null value is allowed. If
197 * set to false, non-null relationships must always exist. If the andromda_persistence_optional
198 * tag is set, then use the tagged value, otherwise determine if null value is allowed by way of
199 * multiplicity on the association end.
200 * @return (boolean)handleIsOptional()
201 */
202 public final boolean isOptional()
203 {
204 boolean optional3a = this.__optional3a;
205 if (!this.__optional3aSet)
206 {
207 // optional has no pre constraints
208 optional3a = handleIsOptional();
209 // optional has no post constraints
210 this.__optional3a = optional3a;
211 if (isMetafacadePropertyCachingEnabled())
212 {
213 this.__optional3aSet = true;
214 }
215 }
216 return optional3a;
217 }
218
219 /**
220 * @see org.andromda.cartridges.ejb3.metafacades.EJB3AssociationEndFacade#getOrderByClause()
221 * @return String
222 */
223 protected abstract String handleGetOrderByClause();
224
225 private String __orderByClause4a;
226 private boolean __orderByClause4aSet = false;
227
228 /**
229 * The order by clause set to order the returning Collection object on the many side of an
230 * association.
231 * @return (String)handleGetOrderByClause()
232 */
233 public final String getOrderByClause()
234 {
235 String orderByClause4a = this.__orderByClause4a;
236 if (!this.__orderByClause4aSet)
237 {
238 // orderByClause has no pre constraints
239 orderByClause4a = handleGetOrderByClause();
240 // orderByClause has no post constraints
241 this.__orderByClause4a = orderByClause4a;
242 if (isMetafacadePropertyCachingEnabled())
243 {
244 this.__orderByClause4aSet = true;
245 }
246 }
247 return orderByClause4a;
248 }
249
250 /**
251 * @see org.andromda.cartridges.ejb3.metafacades.EJB3AssociationEndFacade#getColumnDefinition()
252 * @return String
253 */
254 protected abstract String handleGetColumnDefinition();
255
256 private String __columnDefinition5a;
257 private boolean __columnDefinition5aSet = false;
258
259 /**
260 * Defines the column definition DDL used when creating table schema - use to override default
261 * container DDL.
262 * @return (String)handleGetColumnDefinition()
263 */
264 public final String getColumnDefinition()
265 {
266 String columnDefinition5a = this.__columnDefinition5a;
267 if (!this.__columnDefinition5aSet)
268 {
269 // columnDefinition has no pre constraints
270 columnDefinition5a = handleGetColumnDefinition();
271 // columnDefinition has no post constraints
272 this.__columnDefinition5a = columnDefinition5a;
273 if (isMetafacadePropertyCachingEnabled())
274 {
275 this.__columnDefinition5aSet = true;
276 }
277 }
278 return columnDefinition5a;
279 }
280
281 /**
282 * @see org.andromda.cartridges.ejb3.metafacades.EJB3AssociationEndFacade#isEager()
283 * @return boolean
284 */
285 protected abstract boolean handleIsEager();
286
287 private boolean __eager6a;
288 private boolean __eager6aSet = false;
289
290 /**
291 * Determine if the fetch type for this entity relationship end is eager loading.
292 * @return (boolean)handleIsEager()
293 */
294 public final boolean isEager()
295 {
296 boolean eager6a = this.__eager6a;
297 if (!this.__eager6aSet)
298 {
299 // eager has no pre constraints
300 eager6a = handleIsEager();
301 // eager has no post constraints
302 this.__eager6a = eager6a;
303 if (isMetafacadePropertyCachingEnabled())
304 {
305 this.__eager6aSet = true;
306 }
307 }
308 return eager6a;
309 }
310
311 /**
312 * @see org.andromda.cartridges.ejb3.metafacades.EJB3AssociationEndFacade#isLazy()
313 * @return boolean
314 */
315 protected abstract boolean handleIsLazy();
316
317 private boolean __lazy7a;
318 private boolean __lazy7aSet = false;
319
320 /**
321 * Determine if the fetch type for this entity relationship end is lazy loading.
322 * @return (boolean)handleIsLazy()
323 */
324 public final boolean isLazy()
325 {
326 boolean lazy7a = this.__lazy7a;
327 if (!this.__lazy7aSet)
328 {
329 // lazy has no pre constraints
330 lazy7a = handleIsLazy();
331 // lazy has no post constraints
332 this.__lazy7a = lazy7a;
333 if (isMetafacadePropertyCachingEnabled())
334 {
335 this.__lazy7aSet = true;
336 }
337 }
338 return lazy7a;
339 }
340
341 /**
342 * @see org.andromda.cartridges.ejb3.metafacades.EJB3AssociationEndFacade#getCascadeType()
343 * @return String
344 */
345 protected abstract String handleGetCascadeType();
346
347 private String __cascadeType8a;
348 private boolean __cascadeType8aSet = false;
349
350 /**
351 * Return the cascade type attributes as an array of this association end or null if no relevant
352 * cascade attribute is found.
353 * @return (String)handleGetCascadeType()
354 */
355 public final String getCascadeType()
356 {
357 String cascadeType8a = this.__cascadeType8a;
358 if (!this.__cascadeType8aSet)
359 {
360 // cascadeType has no pre constraints
361 cascadeType8a = handleGetCascadeType();
362 // cascadeType has no post constraints
363 this.__cascadeType8a = cascadeType8a;
364 if (isMetafacadePropertyCachingEnabled())
365 {
366 this.__cascadeType8aSet = true;
367 }
368 }
369 return cascadeType8a;
370 }
371
372 /**
373 * @see org.andromda.cartridges.ejb3.metafacades.EJB3AssociationEndFacade#getCompositionCascadeType()
374 * @return String
375 */
376 protected abstract String handleGetCompositionCascadeType();
377
378 private String __compositionCascadeType9a;
379 private boolean __compositionCascadeType9aSet = false;
380
381 /**
382 * Returns the default cascade property specified for UML composition.
383 * @return (String)handleGetCompositionCascadeType()
384 */
385 public final String getCompositionCascadeType()
386 {
387 String compositionCascadeType9a = this.__compositionCascadeType9a;
388 if (!this.__compositionCascadeType9aSet)
389 {
390 // compositionCascadeType has no pre constraints
391 compositionCascadeType9a = handleGetCompositionCascadeType();
392 // compositionCascadeType has no post constraints
393 this.__compositionCascadeType9a = compositionCascadeType9a;
394 if (isMetafacadePropertyCachingEnabled())
395 {
396 this.__compositionCascadeType9aSet = true;
397 }
398 }
399 return compositionCascadeType9a;
400 }
401
402 /**
403 * @see org.andromda.cartridges.ejb3.metafacades.EJB3AssociationEndFacade#getAggregationCascadeType()
404 * @return String
405 */
406 protected abstract String handleGetAggregationCascadeType();
407
408 private String __aggregationCascadeType10a;
409 private boolean __aggregationCascadeType10aSet = false;
410
411 /**
412 * Returns the default cascade property specified for UML aggregation.
413 * @return (String)handleGetAggregationCascadeType()
414 */
415 public final String getAggregationCascadeType()
416 {
417 String aggregationCascadeType10a = this.__aggregationCascadeType10a;
418 if (!this.__aggregationCascadeType10aSet)
419 {
420 // aggregationCascadeType has no pre constraints
421 aggregationCascadeType10a = handleGetAggregationCascadeType();
422 // aggregationCascadeType has no post constraints
423 this.__aggregationCascadeType10a = aggregationCascadeType10a;
424 if (isMetafacadePropertyCachingEnabled())
425 {
426 this.__aggregationCascadeType10aSet = true;
427 }
428 }
429 return aggregationCascadeType10a;
430 }
431
432 /**
433 * @see org.andromda.cartridges.ejb3.metafacades.EJB3AssociationEndFacade#getCollectionType()
434 * @return String
435 */
436 protected abstract String handleGetCollectionType();
437
438 private String __collectionType11a;
439 private boolean __collectionType11aSet = false;
440
441 /**
442 * Returns the collection type defined on this association end using the
443 * andromda_persistence_collection_type tagged value.
444 * If undefined use the following strategy:
445 * - If ordered collection type: return a list
446 * - Otherwise, return the default association collection type.
447 * @return (String)handleGetCollectionType()
448 */
449 public final String getCollectionType()
450 {
451 String collectionType11a = this.__collectionType11a;
452 if (!this.__collectionType11aSet)
453 {
454 // collectionType has no pre constraints
455 collectionType11a = handleGetCollectionType();
456 // collectionType has no post constraints
457 this.__collectionType11a = collectionType11a;
458 if (isMetafacadePropertyCachingEnabled())
459 {
460 this.__collectionType11aSet = true;
461 }
462 }
463 return collectionType11a;
464 }
465
466 /**
467 * @see org.andromda.cartridges.ejb3.metafacades.EJB3AssociationEndFacade#isMap()
468 * @return boolean
469 */
470 protected abstract boolean handleIsMap();
471
472 private boolean __map12a;
473 private boolean __map12aSet = false;
474
475 /**
476 * Returns true if the collection type is a map. This will only be the case if the association
477 * end multiplicity is defined as unordered.
478 * @return (boolean)handleIsMap()
479 */
480 public final boolean isMap()
481 {
482 boolean map12a = this.__map12a;
483 if (!this.__map12aSet)
484 {
485 // map has no pre constraints
486 map12a = handleIsMap();
487 // map has no post constraints
488 this.__map12a = map12a;
489 if (isMetafacadePropertyCachingEnabled())
490 {
491 this.__map12aSet = true;
492 }
493 }
494 return map12a;
495 }
496
497 /**
498 * @see org.andromda.cartridges.ejb3.metafacades.EJB3AssociationEndFacade#isList()
499 * @return boolean
500 */
501 protected abstract boolean handleIsList();
502
503 private boolean __list13a;
504 private boolean __list13aSet = false;
505
506 /**
507 * Returns true if the collection type is a list. This will only be the case if the association
508 * end multiplicity is defined as ordered.
509 * @return (boolean)handleIsList()
510 */
511 public final boolean isList()
512 {
513 boolean list13a = this.__list13a;
514 if (!this.__list13aSet)
515 {
516 // list has no pre constraints
517 list13a = handleIsList();
518 // list has no post constraints
519 this.__list13a = list13a;
520 if (isMetafacadePropertyCachingEnabled())
521 {
522 this.__list13aSet = true;
523 }
524 }
525 return list13a;
526 }
527
528 /**
529 * @see org.andromda.cartridges.ejb3.metafacades.EJB3AssociationEndFacade#isSet()
530 * @return boolean
531 */
532 protected abstract boolean handleIsSet();
533
534 private boolean __set14a;
535 private boolean __set14aSet = false;
536
537 /**
538 * Returns true if the collection type is a set. This will only be the case if the association
539 * end multiplicity is defined as unordered.
540 * @return (boolean)handleIsSet()
541 */
542 public final boolean isSet()
543 {
544 boolean set14a = this.__set14a;
545 if (!this.__set14aSet)
546 {
547 // set has no pre constraints
548 set14a = handleIsSet();
549 // set has no post constraints
550 this.__set14a = set14a;
551 if (isMetafacadePropertyCachingEnabled())
552 {
553 this.__set14aSet = true;
554 }
555 }
556 return set14a;
557 }
558
559 /**
560 * @see org.andromda.cartridges.ejb3.metafacades.EJB3AssociationEndFacade#getLabelName()
561 * @return String
562 */
563 protected abstract String handleGetLabelName();
564
565 private String __labelName15a;
566 private boolean __labelName15aSet = false;
567
568 /**
569 * Returns the label name for the association end used as the display attribute for manageable
570 * entities.
571 * @return (String)handleGetLabelName()
572 */
573 public final String getLabelName()
574 {
575 String labelName15a = this.__labelName15a;
576 if (!this.__labelName15aSet)
577 {
578 // labelName has no pre constraints
579 labelName15a = handleGetLabelName();
580 // labelName has no post constraints
581 this.__labelName15a = labelName15a;
582 if (isMetafacadePropertyCachingEnabled())
583 {
584 this.__labelName15aSet = true;
585 }
586 }
587 return labelName15a;
588 }
589
590 /**
591 * @see org.andromda.cartridges.ejb3.metafacades.EJB3AssociationEndFacade#getGetterLabelName()
592 * @return String
593 */
594 protected abstract String handleGetGetterLabelName();
595
596 private String __getterLabelName16a;
597 private boolean __getterLabelName16aSet = false;
598
599 /**
600 * Returns the getter name for the label name of the display attribute of the manageable entity.
601 * @return (String)handleGetGetterLabelName()
602 */
603 public final String getGetterLabelName()
604 {
605 String getterLabelName16a = this.__getterLabelName16a;
606 if (!this.__getterLabelName16aSet)
607 {
608 // getterLabelName has no pre constraints
609 getterLabelName16a = handleGetGetterLabelName();
610 // getterLabelName has no post constraints
611 this.__getterLabelName16a = getterLabelName16a;
612 if (isMetafacadePropertyCachingEnabled())
613 {
614 this.__getterLabelName16aSet = true;
615 }
616 }
617 return getterLabelName16a;
618 }
619
620 /**
621 * @see org.andromda.cartridges.ejb3.metafacades.EJB3AssociationEndFacade#getSetterLabelName()
622 * @return String
623 */
624 protected abstract String handleGetSetterLabelName();
625
626 private String __setterLabelName17a;
627 private boolean __setterLabelName17aSet = false;
628
629 /**
630 * Returns the setter name for the label name of the display attribute of the manageable entity.
631 * @return (String)handleGetSetterLabelName()
632 */
633 public final String getSetterLabelName()
634 {
635 String setterLabelName17a = this.__setterLabelName17a;
636 if (!this.__setterLabelName17aSet)
637 {
638 // setterLabelName has no pre constraints
639 setterLabelName17a = handleGetSetterLabelName();
640 // setterLabelName has no post constraints
641 this.__setterLabelName17a = setterLabelName17a;
642 if (isMetafacadePropertyCachingEnabled())
643 {
644 this.__setterLabelName17aSet = true;
645 }
646 }
647 return setterLabelName17a;
648 }
649
650 /**
651 * @see org.andromda.cartridges.ejb3.metafacades.EJB3AssociationEndFacade#getCacheType()
652 * @return String
653 */
654 protected abstract String handleGetCacheType();
655
656 private String __cacheType18a;
657 private boolean __cacheType18aSet = false;
658
659 /**
660 * Provides the cache policy for the entity association Collection.
661 * Posible values are NONE, READ_WRITE, NONSTRICT_READ_WRITE, READ_ONLY, TRANSACTIONAL.
662 * @return (String)handleGetCacheType()
663 */
664 public final String getCacheType()
665 {
666 String cacheType18a = this.__cacheType18a;
667 if (!this.__cacheType18aSet)
668 {
669 // cacheType has no pre constraints
670 cacheType18a = handleGetCacheType();
671 // cacheType has no post constraints
672 this.__cacheType18a = cacheType18a;
673 if (isMetafacadePropertyCachingEnabled())
674 {
675 this.__cacheType18aSet = true;
676 }
677 }
678 return cacheType18a;
679 }
680
681 /**
682 * @see org.andromda.cartridges.ejb3.metafacades.EJB3AssociationEndFacade#isAssociationCacheEnabled()
683 * @return boolean
684 */
685 protected abstract boolean handleIsAssociationCacheEnabled();
686
687 private boolean __associationCacheEnabled19a;
688 private boolean __associationCacheEnabled19aSet = false;
689
690 /**
691 * Returns true if association caching has been enabled via namespace property
692 * hibernateEnableAssociationCache.
693 * @return (boolean)handleIsAssociationCacheEnabled()
694 */
695 public final boolean isAssociationCacheEnabled()
696 {
697 boolean associationCacheEnabled19a = this.__associationCacheEnabled19a;
698 if (!this.__associationCacheEnabled19aSet)
699 {
700 // associationCacheEnabled has no pre constraints
701 associationCacheEnabled19a = handleIsAssociationCacheEnabled();
702 // associationCacheEnabled has no post constraints
703 this.__associationCacheEnabled19a = associationCacheEnabled19a;
704 if (isMetafacadePropertyCachingEnabled())
705 {
706 this.__associationCacheEnabled19aSet = true;
707 }
708 }
709 return associationCacheEnabled19a;
710 }
711
712 /**
713 * @see org.andromda.cartridges.ejb3.metafacades.EJB3AssociationEndFacade#getCollectionTypeImplementation()
714 * @return String
715 */
716 protected abstract String handleGetCollectionTypeImplementation();
717
718 private String __collectionTypeImplementation20a;
719 private boolean __collectionTypeImplementation20aSet = false;
720
721 /**
722 * The actual implementation of the collection type.
723 * @return (String)handleGetCollectionTypeImplementation()
724 */
725 public final String getCollectionTypeImplementation()
726 {
727 String collectionTypeImplementation20a = this.__collectionTypeImplementation20a;
728 if (!this.__collectionTypeImplementation20aSet)
729 {
730 // collectionTypeImplementation has no pre constraints
731 collectionTypeImplementation20a = handleGetCollectionTypeImplementation();
732 // collectionTypeImplementation has no post constraints
733 this.__collectionTypeImplementation20a = collectionTypeImplementation20a;
734 if (isMetafacadePropertyCachingEnabled())
735 {
736 this.__collectionTypeImplementation20aSet = true;
737 }
738 }
739 return collectionTypeImplementation20a;
740 }
741
742 /**
743 * @see org.andromda.cartridges.ejb3.metafacades.EJB3AssociationEndFacade#isCollection()
744 * @return boolean
745 */
746 protected abstract boolean handleIsCollection();
747
748 private boolean __collection21a;
749 private boolean __collection21aSet = false;
750
751 /**
752 * Returns true if the collection type is a collection. This will only be the case if the
753 * association end multiplicity is defined as ordered.
754 * @return (boolean)handleIsCollection()
755 */
756 public final boolean isCollection()
757 {
758 boolean collection21a = this.__collection21a;
759 if (!this.__collection21aSet)
760 {
761 // collection has no pre constraints
762 collection21a = handleIsCollection();
763 // collection has no post constraints
764 this.__collection21a = collection21a;
765 if (isMetafacadePropertyCachingEnabled())
766 {
767 this.__collection21aSet = true;
768 }
769 }
770 return collection21a;
771 }
772
773 /**
774 * @see org.andromda.cartridges.ejb3.metafacades.EJB3AssociationEndFacade#getCollectionIndexType()
775 * @return String
776 */
777 protected abstract String handleGetCollectionIndexType();
778
779 private String __collectionIndexType22a;
780 private boolean __collectionIndexType22aSet = false;
781
782 /**
783 * this will only apply for Maps; it will return the type of the attribute specified on the
784 * CollectionIndexName tagged value
785 * @return (String)handleGetCollectionIndexType()
786 */
787 public final String getCollectionIndexType()
788 {
789 String collectionIndexType22a = this.__collectionIndexType22a;
790 if (!this.__collectionIndexType22aSet)
791 {
792 // collectionIndexType has no pre constraints
793 collectionIndexType22a = handleGetCollectionIndexType();
794 // collectionIndexType has no post constraints
795 this.__collectionIndexType22a = collectionIndexType22a;
796 if (isMetafacadePropertyCachingEnabled())
797 {
798 this.__collectionIndexType22aSet = true;
799 }
800 }
801 return collectionIndexType22a;
802 }
803
804 /**
805 * @see org.andromda.cartridges.ejb3.metafacades.EJB3AssociationEndFacade#getCollectionIndexName()
806 * @return String
807 */
808 protected abstract String handleGetCollectionIndexName();
809
810 private String __collectionIndexName23a;
811 private boolean __collectionIndexName23aSet = false;
812
813 /**
814 * Returns the association end collection index name.
815 * @return (String)handleGetCollectionIndexName()
816 */
817 public final String getCollectionIndexName()
818 {
819 String collectionIndexName23a = this.__collectionIndexName23a;
820 if (!this.__collectionIndexName23aSet)
821 {
822 // collectionIndexName has no pre constraints
823 collectionIndexName23a = handleGetCollectionIndexName();
824 // collectionIndexName has no post constraints
825 this.__collectionIndexName23a = collectionIndexName23a;
826 if (isMetafacadePropertyCachingEnabled())
827 {
828 this.__collectionIndexName23aSet = true;
829 }
830 }
831 return collectionIndexName23a;
832 }
833
834 /**
835 * @see org.andromda.cartridges.ejb3.metafacades.EJB3AssociationEndFacade#getDefaultCollectionInterface()
836 * @return String
837 */
838 protected abstract String handleGetDefaultCollectionInterface();
839
840 private String __defaultCollectionInterface24a;
841 private boolean __defaultCollectionInterface24aSet = false;
842
843 /**
844 * Returns the default collection interface from namespace descriptor.
845 * @return (String)handleGetDefaultCollectionInterface()
846 */
847 public final String getDefaultCollectionInterface()
848 {
849 String defaultCollectionInterface24a = this.__defaultCollectionInterface24a;
850 if (!this.__defaultCollectionInterface24aSet)
851 {
852 // defaultCollectionInterface has no pre constraints
853 defaultCollectionInterface24a = handleGetDefaultCollectionInterface();
854 // defaultCollectionInterface has no post constraints
855 this.__defaultCollectionInterface24a = defaultCollectionInterface24a;
856 if (isMetafacadePropertyCachingEnabled())
857 {
858 this.__defaultCollectionInterface24aSet = true;
859 }
860 }
861 return defaultCollectionInterface24a;
862 }
863
864 /**
865 * @see org.andromda.cartridges.ejb3.metafacades.EJB3AssociationEndFacade#isCollectionInterfaceSortedSet()
866 * @return boolean
867 */
868 protected abstract boolean handleIsCollectionInterfaceSortedSet();
869
870 private boolean __collectionInterfaceSortedSet25a;
871 private boolean __collectionInterfaceSortedSet25aSet = false;
872
873 /**
874 * Returns true if the collection interface for this association end is java.util.SortedSet.
875 * @return (boolean)handleIsCollectionInterfaceSortedSet()
876 */
877 public final boolean isCollectionInterfaceSortedSet()
878 {
879 boolean collectionInterfaceSortedSet25a = this.__collectionInterfaceSortedSet25a;
880 if (!this.__collectionInterfaceSortedSet25aSet)
881 {
882 // collectionInterfaceSortedSet has no pre constraints
883 collectionInterfaceSortedSet25a = handleIsCollectionInterfaceSortedSet();
884 // collectionInterfaceSortedSet has no post constraints
885 this.__collectionInterfaceSortedSet25a = collectionInterfaceSortedSet25a;
886 if (isMetafacadePropertyCachingEnabled())
887 {
888 this.__collectionInterfaceSortedSet25aSet = true;
889 }
890 }
891 return collectionInterfaceSortedSet25a;
892 }
893
894 /**
895 * @see org.andromda.cartridges.ejb3.metafacades.EJB3AssociationEndFacade#getCollectionTypeImplemenationClass()
896 * @return String
897 */
898 protected abstract String handleGetCollectionTypeImplemenationClass();
899
900 private String __collectionTypeImplemenationClass26a;
901 private boolean __collectionTypeImplemenationClass26aSet = false;
902
903 /**
904 * The fully qualified class name of the collection implementation type.
905 * @return (String)handleGetCollectionTypeImplemenationClass()
906 */
907 public final String getCollectionTypeImplemenationClass()
908 {
909 String collectionTypeImplemenationClass26a = this.__collectionTypeImplemenationClass26a;
910 if (!this.__collectionTypeImplemenationClass26aSet)
911 {
912 // collectionTypeImplemenationClass has no pre constraints
913 collectionTypeImplemenationClass26a = handleGetCollectionTypeImplemenationClass();
914 // collectionTypeImplemenationClass has no post constraints
915 this.__collectionTypeImplemenationClass26a = collectionTypeImplemenationClass26a;
916 if (isMetafacadePropertyCachingEnabled())
917 {
918 this.__collectionTypeImplemenationClass26aSet = true;
919 }
920 }
921 return collectionTypeImplemenationClass26a;
922 }
923
924 /**
925 * @see org.andromda.cartridges.ejb3.metafacades.EJB3AssociationEndFacade#getHibernateCascadeType()
926 * @return String
927 */
928 protected abstract String handleGetHibernateCascadeType();
929
930 private String __hibernateCascadeType27a;
931 private boolean __hibernateCascadeType27aSet = false;
932
933 /**
934 * Returns the Hibernate cascade attribute of this association end.
935 * @return (String)handleGetHibernateCascadeType()
936 */
937 public final String getHibernateCascadeType()
938 {
939 String hibernateCascadeType27a = this.__hibernateCascadeType27a;
940 if (!this.__hibernateCascadeType27aSet)
941 {
942 // hibernateCascadeType has no pre constraints
943 hibernateCascadeType27a = handleGetHibernateCascadeType();
944 // hibernateCascadeType has no post constraints
945 this.__hibernateCascadeType27a = hibernateCascadeType27a;
946 if (isMetafacadePropertyCachingEnabled())
947 {
948 this.__hibernateCascadeType27aSet = true;
949 }
950 }
951 return hibernateCascadeType27a;
952 }
953
954 /**
955 * @see org.andromda.cartridges.ejb3.metafacades.EJB3AssociationEndFacade#isHibernateCascadeExists()
956 * @return boolean
957 */
958 protected abstract boolean handleIsHibernateCascadeExists();
959
960 private boolean __hibernateCascadeExists28a;
961 private boolean __hibernateCascadeExists28aSet = false;
962
963 /**
964 * Returns true if a Hibernate cascade attribute is defined for this association end.
965 * @return (boolean)handleIsHibernateCascadeExists()
966 */
967 public final boolean isHibernateCascadeExists()
968 {
969 boolean hibernateCascadeExists28a = this.__hibernateCascadeExists28a;
970 if (!this.__hibernateCascadeExists28aSet)
971 {
972 // hibernateCascadeExists has no pre constraints
973 hibernateCascadeExists28a = handleIsHibernateCascadeExists();
974 // hibernateCascadeExists has no post constraints
975 this.__hibernateCascadeExists28a = hibernateCascadeExists28a;
976 if (isMetafacadePropertyCachingEnabled())
977 {
978 this.__hibernateCascadeExists28aSet = true;
979 }
980 }
981 return hibernateCascadeExists28a;
982 }
983
984 /**
985 * @see org.andromda.cartridges.ejb3.metafacades.EJB3AssociationEndFacade#isForeignKeyConstraintDefined()
986 * @return boolean
987 */
988 protected abstract boolean handleIsForeignKeyConstraintDefined();
989
990 private boolean __foreignKeyConstraintDefined29a;
991 private boolean __foreignKeyConstraintDefined29aSet = false;
992
993 /**
994 * Returns true if a foreign key constraint has been defined explicitly by the user. Otherwise
995 * returns false. This will determine if the ForeignKey annotation will be rendered. We
996 * require this because there is no clean way of defining the constraint name for all
997 * constraints as there may be a chance that two constraints may have the same name. This
998 * vilates the database integrity.
999 * @return (boolean)handleIsForeignKeyConstraintDefined()
1000 */
1001 public final boolean isForeignKeyConstraintDefined()
1002 {
1003 boolean foreignKeyConstraintDefined29a = this.__foreignKeyConstraintDefined29a;
1004 if (!this.__foreignKeyConstraintDefined29aSet)
1005 {
1006 // foreignKeyConstraintDefined has no pre constraints
1007 foreignKeyConstraintDefined29a = handleIsForeignKeyConstraintDefined();
1008 // foreignKeyConstraintDefined has no post constraints
1009 this.__foreignKeyConstraintDefined29a = foreignKeyConstraintDefined29a;
1010 if (isMetafacadePropertyCachingEnabled())
1011 {
1012 this.__foreignKeyConstraintDefined29aSet = true;
1013 }
1014 }
1015 return foreignKeyConstraintDefined29a;
1016 }
1017
1018 /**
1019 * @see org.andromda.cartridges.ejb3.metafacades.EJB3AssociationEndFacade#isColumnNullable()
1020 * @return boolean
1021 */
1022 protected abstract boolean handleIsColumnNullable();
1023
1024 private boolean __columnNullable30a;
1025 private boolean __columnNullable30aSet = false;
1026
1027 /**
1028 * Whether the column can be nullable. False for identifier and unique fields. If
1029 * andromda_persistence_column_nullable tag is set, the tagged value is used. Otherwise,
1030 * determine if this attribute is required from the multiplicity set on the attribute.
1031 * @return (boolean)handleIsColumnNullable()
1032 */
1033 public final boolean isColumnNullable()
1034 {
1035 boolean columnNullable30a = this.__columnNullable30a;
1036 if (!this.__columnNullable30aSet)
1037 {
1038 // columnNullable has no pre constraints
1039 columnNullable30a = handleIsColumnNullable();
1040 // columnNullable has no post constraints
1041 this.__columnNullable30a = columnNullable30a;
1042 if (isMetafacadePropertyCachingEnabled())
1043 {
1044 this.__columnNullable30aSet = true;
1045 }
1046 }
1047 return columnNullable30a;
1048 }
1049
1050 // ---------------- business methods ----------------------
1051
1052 /**
1053 * Method to be implemented in descendants
1054 * Returns true if the tagged value with the specified name exists for the association end.
1055 * @param name
1056 * @return boolean
1057 */
1058 protected abstract boolean handleHasTaggedValue(String name);
1059
1060 /**
1061 * Returns true if the tagged value with the specified name exists for the association end.
1062 * @param name String
1063 * TODO: Model Documentation for
1064 * org.andromda.cartridges.ejb3.metafacades.EJB3AssociationEndFacade.hasTaggedValue(name)
1065 * @return handleHasTaggedValue(name)
1066 */
1067 public boolean hasTaggedValue(String name)
1068 {
1069 // hasTaggedValue has no pre constraints
1070 boolean returnValue = handleHasTaggedValue(name);
1071 // hasTaggedValue has no post constraints
1072 return returnValue;
1073 }
1074
1075 /**
1076 * Method to be implemented in descendants
1077 * Returns the name of the foreign key constraint to use for name property of
1078 * org.hibernate.annotations.ForeignKey annotation used for Many-To-One,
1079 * One-To-One and Many-To-Many relationships.
1080 * @param suffix
1081 * @return String
1082 */
1083 protected abstract String handleGetForeignKeyConstraintName(String suffix);
1084
1085 /**
1086 * Returns the name of the foreign key constraint to use for name property of
1087 * org.hibernate.annotations.ForeignKey annotation used for Many-To-One,
1088 * One-To-One and Many-To-Many relationships.
1089 * @param suffix String
1090 * This is the referenced primary key column name.
1091 * @return handleGetForeignKeyConstraintName(suffix)
1092 */
1093 public String getForeignKeyConstraintName(String suffix)
1094 {
1095 // getForeignKeyConstraintName has no pre constraints
1096 String returnValue = handleGetForeignKeyConstraintName(suffix);
1097 // getForeignKeyConstraintName has no post constraints
1098 return returnValue;
1099 }
1100
1101 /**
1102 * Method to be implemented in descendants
1103 * The actual implementation of the collection type.
1104 * @param arg
1105 * @return String
1106 */
1107 protected abstract String handleGetCollectionTypeImplementation(String arg);
1108
1109 /**
1110 * The actual implementation of the collection type.
1111 * @param arg String
1112 * Arguememt to the Collection type implemenation constructor.
1113 * @return handleGetCollectionTypeImplementation(arg)
1114 */
1115 public String getCollectionTypeImplementation(String arg)
1116 {
1117 // getCollectionTypeImplementation has no pre constraints
1118 String returnValue = handleGetCollectionTypeImplementation(arg);
1119 // getCollectionTypeImplementation has no post constraints
1120 return returnValue;
1121 }
1122
1123 /**
1124 * Method to be implemented in descendants
1125 * Returns the name of the foreign key to use for name property of JoinColumn/InverseJoinColumn
1126 * used in JoinTable for One-To-Many and Many-To-Many relationships.
1127 * @param suffix
1128 * @return String
1129 */
1130 protected abstract String handleGetForeignKeyName(String suffix);
1131
1132 /**
1133 * Returns the name of the foreign key to use for name property of JoinColumn/InverseJoinColumn
1134 * used in JoinTable for One-To-Many and Many-To-Many relationships.
1135 * @param suffix String
1136 * TODO: Model Documentation for
1137 * org.andromda.cartridges.ejb3.metafacades.EJB3AssociationEndFacade.getForeignKeyName(suffix)
1138 * @return handleGetForeignKeyName(suffix)
1139 */
1140 public String getForeignKeyName(String suffix)
1141 {
1142 // getForeignKeyName has no pre constraints
1143 String returnValue = handleGetForeignKeyName(suffix);
1144 // getForeignKeyName has no post constraints
1145 return returnValue;
1146 }
1147
1148 /**
1149 * @return true
1150 * @see EntityAssociationEnd
1151 */
1152 public boolean isEntityAssociationEndMetaType()
1153 {
1154 return true;
1155 }
1156
1157 /**
1158 * @return true
1159 * @see AssociationEndFacade
1160 */
1161 public boolean isAssociationEndFacadeMetaType()
1162 {
1163 return true;
1164 }
1165
1166 /**
1167 * @return true
1168 * @see ModelElementFacade
1169 */
1170 public boolean isModelElementFacadeMetaType()
1171 {
1172 return true;
1173 }
1174
1175 // ----------- delegates to EntityAssociationEnd ------------
1176 /**
1177 * A name suitable for use when adding new elements to this association end in programming code.
1178 * @see AssociationEndFacade#getAdderName()
1179 */
1180 public String getAdderName()
1181 {
1182 return this.getSuperEntityAssociationEnd().getAdderName();
1183 }
1184
1185 /**
1186 * Returns the value of the 'Aggregation' attribute (none, shared, composite). The default value
1187 * is "none". The literals are from the enumeration org.eclipse.uml2.uml.AggregationKind.
1188 * Specifies the kind of aggregation that applies to the Property.
1189 * @see AssociationEndFacade#getAggregationKind()
1190 */
1191 public String getAggregationKind()
1192 {
1193 return this.getSuperEntityAssociationEnd().getAggregationKind();
1194 }
1195
1196 /**
1197 * The association owning this association end.
1198 * @see AssociationEndFacade#getAssociation()
1199 */
1200 public AssociationFacade getAssociation()
1201 {
1202 return this.getSuperEntityAssociationEnd().getAssociation();
1203 }
1204
1205 /**
1206 * UML2: Returns the value of the 'Default' attribute. Specifies a String that represents a
1207 * value to be used when no argument is supplied for the Property. A String that is evaluated to
1208 * give a default value for the Property when an object of the owning Classifier is
1209 * instantiated. Can be something like: new ValueObject(values);
1210 * @see AssociationEndFacade#getDefault()
1211 */
1212 public String getDefault()
1213 {
1214 return this.getSuperEntityAssociationEnd().getDefault();
1215 }
1216
1217 /**
1218 * A name suitable for use when accessing this association end in programming code.
1219 * @see AssociationEndFacade#getGetterName()
1220 */
1221 public String getGetterName()
1222 {
1223 return this.getSuperEntityAssociationEnd().getGetterName();
1224 }
1225
1226 /**
1227 * The name of the type that is returned on the accessor and mutator operations, determined in
1228 * part by the multiplicity.
1229 * @see AssociationEndFacade#getGetterSetterTypeName()
1230 */
1231 public String getGetterSetterTypeName()
1232 {
1233 return this.getSuperEntityAssociationEnd().getGetterSetterTypeName();
1234 }
1235
1236 /**
1237 * the lower value for the multiplicity
1238 * -only applicable for UML2
1239 * @see AssociationEndFacade#getLower()
1240 */
1241 public int getLower()
1242 {
1243 return this.getSuperEntityAssociationEnd().getLower();
1244 }
1245
1246 /**
1247 * The other association end owned by this end's association.
1248 * @see AssociationEndFacade#getOtherEnd()
1249 */
1250 public AssociationEndFacade getOtherEnd()
1251 {
1252 return this.getSuperEntityAssociationEnd().getOtherEnd();
1253 }
1254
1255 /**
1256 * A name suitable for use when removing element from this association end in programming code.
1257 * @see AssociationEndFacade#getRemoverName()
1258 */
1259 public String getRemoverName()
1260 {
1261 return this.getSuperEntityAssociationEnd().getRemoverName();
1262 }
1263
1264 /**
1265 * A name suitable for use when accessing this association end in programming code.
1266 * @see AssociationEndFacade#getSetterName()
1267 */
1268 public String getSetterName()
1269 {
1270 return this.getSuperEntityAssociationEnd().getSetterName();
1271 }
1272
1273 /**
1274 * The classifier attached to this association end.
1275 * @see AssociationEndFacade#getType()
1276 */
1277 public ClassifierFacade getType()
1278 {
1279 return this.getSuperEntityAssociationEnd().getType();
1280 }
1281
1282 /**
1283 * the upper value for the multiplicity (will be -1 for *)
1284 * -only applicable for UML2
1285 * @see AssociationEndFacade#getUpper()
1286 */
1287 public int getUpper()
1288 {
1289 return this.getSuperEntityAssociationEnd().getUpper();
1290 }
1291
1292 /**
1293 * True if this association end represents an aggregation relationship.
1294 * @see AssociationEndFacade#isAggregation()
1295 */
1296 public boolean isAggregation()
1297 {
1298 return this.getSuperEntityAssociationEnd().isAggregation();
1299 }
1300
1301 /**
1302 * Is true if update of one side of the association should also update the other side. false if
1303 * not.
1304 * @see AssociationEndFacade#isBidirectional()
1305 */
1306 public boolean isBidirectional()
1307 {
1308 return this.getSuperEntityAssociationEnd().isBidirectional();
1309 }
1310
1311 /**
1312 * Returns whether or not (true/false) this association end is the child end of the assocation
1313 * (i.e. the other end's aggregation is composition).
1314 * @see AssociationEndFacade#isChild()
1315 */
1316 public boolean isChild()
1317 {
1318 return this.getSuperEntityAssociationEnd().isChild();
1319 }
1320
1321 /**
1322 * True if this association end represents a composition relationship.
1323 * @see AssociationEndFacade#isComposition()
1324 */
1325 public boolean isComposition()
1326 {
1327 return this.getSuperEntityAssociationEnd().isComposition();
1328 }
1329
1330 /**
1331 * If the association end is derived (its value is computed). UML2 only. UML14 always returns
1332 * false. Default=false.
1333 * @see AssociationEndFacade#isDerived()
1334 */
1335 public boolean isDerived()
1336 {
1337 return this.getSuperEntityAssociationEnd().isDerived();
1338 }
1339
1340 /**
1341 * IsLeaf property in the association end property. If true, attribute is final, cannot be
1342 * extended or implemented by a descendant. Default=false.
1343 * @see AssociationEndFacade#isLeaf()
1344 */
1345 public boolean isLeaf()
1346 {
1347 return this.getSuperEntityAssociationEnd().isLeaf();
1348 }
1349
1350 /**
1351 * True if this association end's multiplicity is greater than one.
1352 * @see AssociationEndFacade#isMany()
1353 */
1354 public boolean isMany()
1355 {
1356 return this.getSuperEntityAssociationEnd().isMany();
1357 }
1358
1359 /**
1360 * True if this association end's and the other end's multiplicities are both many.
1361 * @see AssociationEndFacade#isMany2Many()
1362 */
1363 public boolean isMany2Many()
1364 {
1365 return this.getSuperEntityAssociationEnd().isMany2Many();
1366 }
1367
1368 /**
1369 * True if this association end's multiplicity is many while the other end's is one.
1370 * @see AssociationEndFacade#isMany2One()
1371 */
1372 public boolean isMany2One()
1373 {
1374 return this.getSuperEntityAssociationEnd().isMany2One();
1375 }
1376
1377 /**
1378 * True if it is possible to navigate from the other end to this association end .
1379 * @see AssociationEndFacade#isNavigable()
1380 */
1381 public boolean isNavigable()
1382 {
1383 return this.getSuperEntityAssociationEnd().isNavigable();
1384 }
1385
1386 /**
1387 * True if this association end's multiplicity is one while the other end's is many.
1388 * @see AssociationEndFacade#isOne2Many()
1389 */
1390 public boolean isOne2Many()
1391 {
1392 return this.getSuperEntityAssociationEnd().isOne2Many();
1393 }
1394
1395 /**
1396 * True if this association end's and the other end's multiplicities are both one.
1397 * @see AssociationEndFacade#isOne2One()
1398 */
1399 public boolean isOne2One()
1400 {
1401 return this.getSuperEntityAssociationEnd().isOne2One();
1402 }
1403
1404 /**
1405 * Indicates whether or not the association ends are ordered (if multiplicity is greater than
1406 * 1).
1407 * @see AssociationEndFacade#isOrdered()
1408 */
1409 public boolean isOrdered()
1410 {
1411 return this.getSuperEntityAssociationEnd().isOrdered();
1412 }
1413
1414 /**
1415 * True if the association end cannot be changed.
1416 * @see AssociationEndFacade#isReadOnly()
1417 */
1418 public boolean isReadOnly()
1419 {
1420 return this.getSuperEntityAssociationEnd().isReadOnly();
1421 }
1422
1423 /**
1424 * True if this association end's multiplicity is strictly greater than zero.
1425 * @see AssociationEndFacade#isRequired()
1426 */
1427 public boolean isRequired()
1428 {
1429 return this.getSuperEntityAssociationEnd().isRequired();
1430 }
1431
1432 /**
1433 * Indicates if this associationEnd is 'static', meaning it has a classifier scope.
1434 * @see AssociationEndFacade#isStatic()
1435 */
1436 public boolean isStatic()
1437 {
1438 return this.getSuperEntityAssociationEnd().isStatic();
1439 }
1440
1441 /**
1442 * UML2: If the association attribute is unique within the Collection type. UML14 always returns
1443 * false. Unique+Ordered determines the implementation Collection type. Default=false.
1444 * @see AssociationEndFacade#isUnique()
1445 */
1446 public boolean isUnique()
1447 {
1448 return this.getSuperEntityAssociationEnd().isUnique();
1449 }
1450
1451 /**
1452 * The name of the index to create on a column that persists the foreign key attribute.
1453 * @see EntityAssociationEnd#getColumnIndex()
1454 */
1455 public String getColumnIndex()
1456 {
1457 return this.getSuperEntityAssociationEnd().getColumnIndex();
1458 }
1459
1460 /**
1461 * The name of the column that makes up the foreign key.
1462 * @see EntityAssociationEnd#getColumnName()
1463 */
1464 public String getColumnName()
1465 {
1466 return this.getSuperEntityAssociationEnd().getColumnName();
1467 }
1468
1469 /**
1470 * The name of the foreign key constraint to use for databases.
1471 * @see EntityAssociationEnd#getForeignKeyConstraintName()
1472 */
1473 public String getForeignKeyConstraintName()
1474 {
1475 return this.getSuperEntityAssociationEnd().getForeignKeyConstraintName();
1476 }
1477
1478 /**
1479 * The current foreign key suffix specified for this entity association end facade.
1480 * @see EntityAssociationEnd#getForeignKeySuffix()
1481 */
1482 public String getForeignKeySuffix()
1483 {
1484 return this.getSuperEntityAssociationEnd().getForeignKeySuffix();
1485 }
1486
1487 /**
1488 * The SQL type for this the foreign key column of this association end.
1489 * @see EntityAssociationEnd#getSqlType()
1490 */
1491 public String getSqlType()
1492 {
1493 return this.getSuperEntityAssociationEnd().getSqlType();
1494 }
1495
1496 /**
1497 * The name of the unique-key that this unique association end belongs
1498 * @see EntityAssociationEnd#getUniqueGroup()
1499 */
1500 public String getUniqueGroup()
1501 {
1502 return this.getSuperEntityAssociationEnd().getUniqueGroup();
1503 }
1504
1505 /**
1506 * Indicates whether or not a foreign identifier should be used for the entity that owns this
1507 * association end. This would only make sense in the case of a child in a one-to-one
1508 * parent-child association. If this flag is true, then the identifier of this entity should
1509 * also be used as the foreign key to the related parent entity.
1510 * @see EntityAssociationEnd#isForeignIdentifier()
1511 */
1512 public boolean isForeignIdentifier()
1513 {
1514 return this.getSuperEntityAssociationEnd().isForeignIdentifier();
1515 }
1516
1517 /**
1518 * True if this association is an identifier for its entity.
1519 * @see EntityAssociationEnd#isIdentifier()
1520 */
1521 public boolean isIdentifier()
1522 {
1523 return this.getSuperEntityAssociationEnd().isIdentifier();
1524 }
1525
1526 /**
1527 * True if the associationEnd is marked with identifiers stereotype, false otherwise.
1528 * @see EntityAssociationEnd#isIdentifiersPresent()
1529 */
1530 public boolean isIdentifiersPresent()
1531 {
1532 return this.getSuperEntityAssociationEnd().isIdentifiersPresent();
1533 }
1534
1535 /**
1536 * Indicates this association end should be ignored by the persistence layer.
1537 * @see EntityAssociationEnd#isTransient()
1538 */
1539 public boolean isTransient()
1540 {
1541 return this.getSuperEntityAssociationEnd().isTransient();
1542 }
1543
1544 /**
1545 * Copies all tagged values from the given ModelElementFacade to this model element facade.
1546 * @see ModelElementFacade#copyTaggedValues(ModelElementFacade element)
1547 */
1548 public void copyTaggedValues(ModelElementFacade element)
1549 {
1550 this.getSuperEntityAssociationEnd().copyTaggedValues(element);
1551 }
1552
1553 /**
1554 * Finds the tagged value with the specified 'tagName'. In case there are more values the first
1555 * one found will be returned.
1556 * @see ModelElementFacade#findTaggedValue(String tagName)
1557 */
1558 public Object findTaggedValue(String tagName)
1559 {
1560 return this.getSuperEntityAssociationEnd().findTaggedValue(tagName);
1561 }
1562
1563 /**
1564 * Returns all the values for the tagged value with the specified name. The returned collection
1565 * will contains only String instances, or will be empty. Never null.
1566 * @see ModelElementFacade#findTaggedValues(String tagName)
1567 */
1568 public Collection<Object> findTaggedValues(String tagName)
1569 {
1570 return this.getSuperEntityAssociationEnd().findTaggedValues(tagName);
1571 }
1572
1573 /**
1574 * Returns the fully qualified name of the model element. The fully qualified name includes
1575 * complete package qualified name of the underlying model element. The templates parameter will
1576 * be replaced by the correct one given the binding relation of the parameter to this element.
1577 * @see ModelElementFacade#getBindedFullyQualifiedName(ModelElementFacade bindedElement)
1578 */
1579 public String getBindedFullyQualifiedName(ModelElementFacade bindedElement)
1580 {
1581 return this.getSuperEntityAssociationEnd().getBindedFullyQualifiedName(bindedElement);
1582 }
1583
1584 /**
1585 * Gets all constraints belonging to the model element.
1586 * @see ModelElementFacade#getConstraints()
1587 */
1588 public Collection<ConstraintFacade> getConstraints()
1589 {
1590 return this.getSuperEntityAssociationEnd().getConstraints();
1591 }
1592
1593 /**
1594 * Returns the constraints of the argument kind that have been placed onto this model. Typical
1595 * kinds are "inv", "pre" and "post". Other kinds are possible.
1596 * @see ModelElementFacade#getConstraints(String kind)
1597 */
1598 public Collection<ConstraintFacade> getConstraints(String kind)
1599 {
1600 return this.getSuperEntityAssociationEnd().getConstraints(kind);
1601 }
1602
1603 /**
1604 * Gets the documentation for the model element, The indent argument is prefixed to each line.
1605 * By default this method wraps lines after 64 characters.
1606 * This method is equivalent to <code>getDocumentation(indent, 64)</code>.
1607 * @see ModelElementFacade#getDocumentation(String indent)
1608 */
1609 public String getDocumentation(String indent)
1610 {
1611 return this.getSuperEntityAssociationEnd().getDocumentation(indent);
1612 }
1613
1614 /**
1615 * This method returns the documentation for this model element, with the lines wrapped after
1616 * the specified number of characters, values of less than 1 will indicate no line wrapping is
1617 * required. By default paragraphs are returned as HTML.
1618 * This method is equivalent to <code>getDocumentation(indent, lineLength, true)</code>.
1619 * @see ModelElementFacade#getDocumentation(String indent, int lineLength)
1620 */
1621 public String getDocumentation(String indent, int lineLength)
1622 {
1623 return this.getSuperEntityAssociationEnd().getDocumentation(indent, lineLength);
1624 }
1625
1626 /**
1627 * This method returns the documentation for this model element, with the lines wrapped after
1628 * the specified number of characters, values of less than 1 will indicate no line wrapping is
1629 * required. HTML style determines if HTML Escaping is applied.
1630 * @see ModelElementFacade#getDocumentation(String indent, int lineLength, boolean htmlStyle)
1631 */
1632 public String getDocumentation(String indent, int lineLength, boolean htmlStyle)
1633 {
1634 return this.getSuperEntityAssociationEnd().getDocumentation(indent, lineLength, htmlStyle);
1635 }
1636
1637 /**
1638 * The fully qualified name of this model element.
1639 * @see ModelElementFacade#getFullyQualifiedName()
1640 */
1641 public String getFullyQualifiedName()
1642 {
1643 return this.getSuperEntityAssociationEnd().getFullyQualifiedName();
1644 }
1645
1646 /**
1647 * Returns the fully qualified name of the model element. The fully qualified name includes
1648 * complete package qualified name of the underlying model element. If modelName is true, then
1649 * the original name of the model element (the name contained within the model) will be the name
1650 * returned, otherwise a name from a language mapping will be returned.
1651 * @see ModelElementFacade#getFullyQualifiedName(boolean modelName)
1652 */
1653 public String getFullyQualifiedName(boolean modelName)
1654 {
1655 return this.getSuperEntityAssociationEnd().getFullyQualifiedName(modelName);
1656 }
1657
1658 /**
1659 * Returns the fully qualified name as a path, the returned value always starts with out a slash
1660 * '/'.
1661 * @see ModelElementFacade#getFullyQualifiedNamePath()
1662 */
1663 public String getFullyQualifiedNamePath()
1664 {
1665 return this.getSuperEntityAssociationEnd().getFullyQualifiedNamePath();
1666 }
1667
1668 /**
1669 * Gets the unique identifier of the underlying model element.
1670 * @see ModelElementFacade#getId()
1671 */
1672 public String getId()
1673 {
1674 return this.getSuperEntityAssociationEnd().getId();
1675 }
1676
1677 /**
1678 * UML2: Retrieves the keywords for this element. Used to modify implementation properties which
1679 * are not represented by other properties, i.e. native, transient, volatile, synchronized,
1680 * (added annotations) override, deprecated. Can also be used to suppress compiler warnings:
1681 * (added annotations) unchecked, fallthrough, path, serial, finally, all. Annotations require
1682 * JDK5 compiler level.
1683 * @see ModelElementFacade#getKeywords()
1684 */
1685 public Collection<String> getKeywords()
1686 {
1687 return this.getSuperEntityAssociationEnd().getKeywords();
1688 }
1689
1690 /**
1691 * UML2: Retrieves a localized label for this named element.
1692 * @see ModelElementFacade#getLabel()
1693 */
1694 public String getLabel()
1695 {
1696 return this.getSuperEntityAssociationEnd().getLabel();
1697 }
1698
1699 /**
1700 * The language mappings that have been set for this model element.
1701 * @see ModelElementFacade#getLanguageMappings()
1702 */
1703 public TypeMappings getLanguageMappings()
1704 {
1705 return this.getSuperEntityAssociationEnd().getLanguageMappings();
1706 }
1707
1708 /**
1709 * Return the model containing this model element (multiple models may be loaded and processed
1710 * at the same time).
1711 * @see ModelElementFacade#getModel()
1712 */
1713 public ModelFacade getModel()
1714 {
1715 return this.getSuperEntityAssociationEnd().getModel();
1716 }
1717
1718 /**
1719 * The name of the model element.
1720 * @see ModelElementFacade#getName()
1721 */
1722 public String getName()
1723 {
1724 return this.getSuperEntityAssociationEnd().getName();
1725 }
1726
1727 /**
1728 * Gets the package to which this model element belongs.
1729 * @see ModelElementFacade#getPackage()
1730 */
1731 public ModelElementFacade getPackage()
1732 {
1733 return this.getSuperEntityAssociationEnd().getPackage();
1734 }
1735
1736 /**
1737 * The name of this model element's package.
1738 * @see ModelElementFacade#getPackageName()
1739 */
1740 public String getPackageName()
1741 {
1742 return this.getSuperEntityAssociationEnd().getPackageName();
1743 }
1744
1745 /**
1746 * Gets the package name (optionally providing the ability to retrieve the model name and not
1747 * the mapped name).
1748 * @see ModelElementFacade#getPackageName(boolean modelName)
1749 */
1750 public String getPackageName(boolean modelName)
1751 {
1752 return this.getSuperEntityAssociationEnd().getPackageName(modelName);
1753 }
1754
1755 /**
1756 * Returns the package as a path, the returned value always starts with out a slash '/'.
1757 * @see ModelElementFacade#getPackagePath()
1758 */
1759 public String getPackagePath()
1760 {
1761 return this.getSuperEntityAssociationEnd().getPackagePath();
1762 }
1763
1764 /**
1765 * UML2: Returns the value of the 'Qualified Name' attribute. A name which allows the
1766 * NamedElement to be identified within a hierarchy of nested Namespaces. It is constructed from
1767 * the names of the containing namespaces starting at the root of the hierarchy and ending with
1768 * the name of the NamedElement itself.
1769 * @see ModelElementFacade#getQualifiedName()
1770 */
1771 public String getQualifiedName()
1772 {
1773 return this.getSuperEntityAssociationEnd().getQualifiedName();
1774 }
1775
1776 /**
1777 * Gets the root package for the model element.
1778 * @see ModelElementFacade#getRootPackage()
1779 */
1780 public PackageFacade getRootPackage()
1781 {
1782 return this.getSuperEntityAssociationEnd().getRootPackage();
1783 }
1784
1785 /**
1786 * Gets the dependencies for which this model element is the source.
1787 * @see ModelElementFacade#getSourceDependencies()
1788 */
1789 public Collection<DependencyFacade> getSourceDependencies()
1790 {
1791 return this.getSuperEntityAssociationEnd().getSourceDependencies();
1792 }
1793
1794 /**
1795 * If this model element is the context of an activity graph, this represents that activity
1796 * graph.
1797 * @see ModelElementFacade#getStateMachineContext()
1798 */
1799 public StateMachineFacade getStateMachineContext()
1800 {
1801 return this.getSuperEntityAssociationEnd().getStateMachineContext();
1802 }
1803
1804 /**
1805 * The collection of ALL stereotype names for this model element.
1806 * @see ModelElementFacade#getStereotypeNames()
1807 */
1808 public Collection<String> getStereotypeNames()
1809 {
1810 return this.getSuperEntityAssociationEnd().getStereotypeNames();
1811 }
1812
1813 /**
1814 * Gets all stereotypes for this model element.
1815 * @see ModelElementFacade#getStereotypes()
1816 */
1817 public Collection<StereotypeFacade> getStereotypes()
1818 {
1819 return this.getSuperEntityAssociationEnd().getStereotypes();
1820 }
1821
1822 /**
1823 * Return the TaggedValues associated with this model element, under all stereotypes.
1824 * @see ModelElementFacade#getTaggedValues()
1825 */
1826 public Collection<TaggedValueFacade> getTaggedValues()
1827 {
1828 return this.getSuperEntityAssociationEnd().getTaggedValues();
1829 }
1830
1831 /**
1832 * Gets the dependencies for which this model element is the target.
1833 * @see ModelElementFacade#getTargetDependencies()
1834 */
1835 public Collection<DependencyFacade> getTargetDependencies()
1836 {
1837 return this.getSuperEntityAssociationEnd().getTargetDependencies();
1838 }
1839
1840 /**
1841 * Get the template parameter for this model element having the parameterName
1842 * @see ModelElementFacade#getTemplateParameter(String parameterName)
1843 */
1844 public Object getTemplateParameter(String parameterName)
1845 {
1846 return this.getSuperEntityAssociationEnd().getTemplateParameter(parameterName);
1847 }
1848
1849 /**
1850 * Get the template parameters for this model element
1851 * @see ModelElementFacade#getTemplateParameters()
1852 */
1853 public Collection<TemplateParameterFacade> getTemplateParameters()
1854 {
1855 return this.getSuperEntityAssociationEnd().getTemplateParameters();
1856 }
1857
1858 /**
1859 * The visibility (i.e. public, private, protected or package) of the model element, will
1860 * attempt a lookup for these values in the language mappings (if any).
1861 * @see ModelElementFacade#getVisibility()
1862 */
1863 public String getVisibility()
1864 {
1865 return this.getSuperEntityAssociationEnd().getVisibility();
1866 }
1867
1868 /**
1869 * Returns true if the model element has the exact stereotype (meaning no stereotype inheritance
1870 * is taken into account when searching for the stereotype), false otherwise.
1871 * @see ModelElementFacade#hasExactStereotype(String stereotypeName)
1872 */
1873 public boolean hasExactStereotype(String stereotypeName)
1874 {
1875 return this.getSuperEntityAssociationEnd().hasExactStereotype(stereotypeName);
1876 }
1877
1878 /**
1879 * Does the UML Element contain the named Keyword? Keywords can be separated by space, comma,
1880 * pipe, semicolon, or << >>
1881 * @see ModelElementFacade#hasKeyword(String keywordName)
1882 */
1883 public boolean hasKeyword(String keywordName)
1884 {
1885 return this.getSuperEntityAssociationEnd().hasKeyword(keywordName);
1886 }
1887
1888 /**
1889 * Returns true if the model element has the specified stereotype. If the stereotype itself
1890 * does not match, then a search will be made up the stereotype inheritance hierarchy, and if
1891 * one of the stereotype's ancestors has a matching name this method will return true, false
1892 * otherwise.
1893 * For example, if we have a certain stereotype called <<exception>> and a model element has a
1894 * stereotype called <<applicationException>> which extends <<exception>>, when calling this
1895 * method with 'stereotypeName' defined as 'exception' the method would return true since
1896 * <<applicationException>> inherits from <<exception>>. If you want to check if the model
1897 * element has the exact stereotype, then use the method 'hasExactStereotype' instead.
1898 * @see ModelElementFacade#hasStereotype(String stereotypeName)
1899 */
1900 public boolean hasStereotype(String stereotypeName)
1901 {
1902 return this.getSuperEntityAssociationEnd().hasStereotype(stereotypeName);
1903 }
1904
1905 /**
1906 * True if there are target dependencies from this element that are instances of BindingFacade.
1907 * Deprecated in UML2: Use TemplateBinding parameters instead of dependencies.
1908 * @see ModelElementFacade#isBindingDependenciesPresent()
1909 */
1910 public boolean isBindingDependenciesPresent()
1911 {
1912 return this.getSuperEntityAssociationEnd().isBindingDependenciesPresent();
1913 }
1914
1915 /**
1916 * Indicates if any constraints are present on this model element.
1917 * @see ModelElementFacade#isConstraintsPresent()
1918 */
1919 public boolean isConstraintsPresent()
1920 {
1921 return this.getSuperEntityAssociationEnd().isConstraintsPresent();
1922 }
1923
1924 /**
1925 * Indicates if any documentation is present on this model element.
1926 * @see ModelElementFacade#isDocumentationPresent()
1927 */
1928 public boolean isDocumentationPresent()
1929 {
1930 return this.getSuperEntityAssociationEnd().isDocumentationPresent();
1931 }
1932
1933 /**
1934 * True if this element name is a reserved word in Java, C#, ANSI or ISO C, C++, JavaScript.
1935 * @see ModelElementFacade#isReservedWord()
1936 */
1937 public boolean isReservedWord()
1938 {
1939 return this.getSuperEntityAssociationEnd().isReservedWord();
1940 }
1941
1942 /**
1943 * True is there are template parameters on this model element. For UML2, applies to Class,
1944 * Operation, Property, and Parameter.
1945 * @see ModelElementFacade#isTemplateParametersPresent()
1946 */
1947 public boolean isTemplateParametersPresent()
1948 {
1949 return this.getSuperEntityAssociationEnd().isTemplateParametersPresent();
1950 }
1951
1952 /**
1953 * True if this element name is a valid identifier name in Java, C#, ANSI or ISO C, C++,
1954 * JavaScript. Contains no spaces, special characters etc. Constraint always applied on
1955 * Enumerations and Interfaces, optionally applies on other model elements.
1956 * @see ModelElementFacade#isValidIdentifierName()
1957 */
1958 public boolean isValidIdentifierName()
1959 {
1960 return this.getSuperEntityAssociationEnd().isValidIdentifierName();
1961 }
1962
1963 /**
1964 * Searches for the constraint with the specified 'name' on this model element, and if found
1965 * translates it using the specified 'translation' from a translation library discovered by the
1966 * framework.
1967 * @see ModelElementFacade#translateConstraint(String name, String translation)
1968 */
1969 public String translateConstraint(String name, String translation)
1970 {
1971 return this.getSuperEntityAssociationEnd().translateConstraint(name, translation);
1972 }
1973
1974 /**
1975 * Translates all constraints belonging to this model element with the given 'translation'.
1976 * @see ModelElementFacade#translateConstraints(String translation)
1977 */
1978 public String[] translateConstraints(String translation)
1979 {
1980 return this.getSuperEntityAssociationEnd().translateConstraints(translation);
1981 }
1982
1983 /**
1984 * Translates the constraints of the specified 'kind' belonging to this model element.
1985 * @see ModelElementFacade#translateConstraints(String kind, String translation)
1986 */
1987 public String[] translateConstraints(String kind, String translation)
1988 {
1989 return this.getSuperEntityAssociationEnd().translateConstraints(kind, translation);
1990 }
1991
1992 /**
1993 * @see org.andromda.core.metafacade.MetafacadeBase#initialize()
1994 */
1995 @Override
1996 public void initialize()
1997 {
1998 this.getSuperEntityAssociationEnd().initialize();
1999 }
2000
2001 /**
2002 * @return Object getSuperEntityAssociationEnd().getValidationOwner()
2003 * @see org.andromda.core.metafacade.MetafacadeBase#getValidationOwner()
2004 */
2005 @Override
2006 public Object getValidationOwner()
2007 {
2008 Object owner = this.getSuperEntityAssociationEnd().getValidationOwner();
2009 return owner;
2010 }
2011
2012 /**
2013 * @return String getSuperEntityAssociationEnd().getValidationName()
2014 * @see org.andromda.core.metafacade.MetafacadeBase#getValidationName()
2015 */
2016 @Override
2017 public String getValidationName()
2018 {
2019 String name = this.getSuperEntityAssociationEnd().getValidationName();
2020 return name;
2021 }
2022
2023 /**
2024 * @param validationMessages Collection<ModelValidationMessage>
2025 * @see org.andromda.core.metafacade.MetafacadeBase#validateInvariants(Collection validationMessages)
2026 */
2027 @Override
2028 public void validateInvariants(Collection<ModelValidationMessage> validationMessages)
2029 {
2030 this.getSuperEntityAssociationEnd().validateInvariants(validationMessages);
2031 }
2032
2033 /**
2034 * The property that stores the name of the metafacade.
2035 */
2036 private static final String NAME_PROPERTY = "name";
2037 private static final String FQNAME_PROPERTY = "fullyQualifiedName";
2038
2039 /**
2040 * @see Object#toString()
2041 */
2042 @Override
2043 public String toString()
2044 {
2045 final StringBuilder toString = new StringBuilder(this.getClass().getName());
2046 toString.append("[");
2047 try
2048 {
2049 toString.append(Introspector.instance().getProperty(this, FQNAME_PROPERTY));
2050 }
2051 catch (final Throwable tryAgain)
2052 {
2053 try
2054 {
2055 toString.append(Introspector.instance().getProperty(this, NAME_PROPERTY));
2056 }
2057 catch (final Throwable ignore)
2058 {
2059 // - just ignore when the metafacade doesn't have a name or fullyQualifiedName property
2060 }
2061 }
2062 toString.append("]");
2063 return toString.toString();
2064 }
2065 }