001// license-header java merge-point
002//
003// Attention: generated code (by MetafacadeLogic.vsl) - do not modify!
004//
005package org.andromda.cartridges.hibernate.metafacades;
006
007import java.util.Collection;
008import org.andromda.core.common.Introspector;
009import org.andromda.core.metafacade.MetafacadeBase;
010import org.andromda.core.metafacade.MetafacadeFactory;
011import org.andromda.core.metafacade.ModelValidationMessage;
012import org.andromda.metafacades.uml.ClassifierFacade;
013import org.andromda.metafacades.uml.ConstraintFacade;
014import org.andromda.metafacades.uml.DependencyFacade;
015import org.andromda.metafacades.uml.EntityQueryOperation;
016import org.andromda.metafacades.uml.ModelElementFacade;
017import org.andromda.metafacades.uml.ModelFacade;
018import org.andromda.metafacades.uml.OperationFacade;
019import org.andromda.metafacades.uml.PackageFacade;
020import org.andromda.metafacades.uml.ParameterFacade;
021import org.andromda.metafacades.uml.StateMachineFacade;
022import org.andromda.metafacades.uml.StereotypeFacade;
023import org.andromda.metafacades.uml.TaggedValueFacade;
024import org.andromda.metafacades.uml.TemplateParameterFacade;
025import org.andromda.metafacades.uml.TypeMappings;
026
027/**
028 * Represents a Hibernate finder method.
029 * MetafacadeLogic for HibernateFinderMethod
030 *
031 * @see HibernateFinderMethod
032 */
033public abstract class HibernateFinderMethodLogic
034    extends MetafacadeBase
035    implements HibernateFinderMethod
036{
037    /**
038     * The underlying UML object
039     * @see Object
040     */
041    protected Object metaObject;
042
043    /** Create Metafacade implementation instance using the MetafacadeFactory from the context
044     * @param metaObjectIn
045     * @param context
046     */
047    protected HibernateFinderMethodLogic(Object metaObjectIn, String context)
048    {
049        super(metaObjectIn, getContext(context));
050        this.superEntityQueryOperation =
051           (EntityQueryOperation)
052            MetafacadeFactory.getInstance().createFacadeImpl(
053                    "org.andromda.metafacades.uml.EntityQueryOperation",
054                    metaObjectIn,
055                    getContext(context));
056        this.metaObject = metaObjectIn;
057    }
058
059    /**
060     * Gets the context for this metafacade logic instance.
061     * @param context String. Set to HibernateFinderMethod if null
062     * @return context String
063     */
064    private static String getContext(String context)
065    {
066        if (context == null)
067        {
068            context = "org.andromda.cartridges.hibernate.metafacades.HibernateFinderMethod";
069        }
070        return context;
071    }
072
073    private EntityQueryOperation superEntityQueryOperation;
074    private boolean superEntityQueryOperationInitialized = false;
075
076    /**
077     * Gets the EntityQueryOperation parent instance.
078     * @return this.superEntityQueryOperation EntityQueryOperation
079     */
080    private EntityQueryOperation getSuperEntityQueryOperation()
081    {
082        if (!this.superEntityQueryOperationInitialized)
083        {
084            ((MetafacadeBase)this.superEntityQueryOperation).setMetafacadeContext(this.getMetafacadeContext());
085            this.superEntityQueryOperationInitialized = true;
086        }
087        return this.superEntityQueryOperation;
088    }
089
090    /** Reset context only for non-root metafacades
091     * @param context
092     * @see org.andromda.core.metafacade.MetafacadeBase#resetMetafacadeContext(String context)
093     */
094    @Override
095    public void resetMetafacadeContext(String context)
096    {
097        if (!this.contextRoot) // reset context only for non-root metafacades
098        {
099            context = getContext(context);  // to have same value as in original constructor call
100            setMetafacadeContext (context);
101            if (this.superEntityQueryOperationInitialized)
102            {
103                ((MetafacadeBase)this.superEntityQueryOperation).resetMetafacadeContext(context);
104            }
105        }
106    }
107
108    /**
109     * @return boolean true always
110     * @see HibernateFinderMethod
111     */
112    public boolean isHibernateFinderMethodMetaType()
113    {
114        return true;
115    }
116
117    // --------------- attributes ---------------------
118
119   /**
120    * @see org.andromda.cartridges.hibernate.metafacades.HibernateFinderMethod#isUseNamedParameters()
121    * @return boolean
122    */
123    protected abstract boolean handleIsUseNamedParameters();
124
125    private boolean __useNamedParameters1a;
126    private boolean __useNamedParameters1aSet = false;
127
128    /**
129     * Indicates whether or not the query parameters used for the body of the finder should be named
130     * ':someParam' or unnamed '?'.
131     * @return (boolean)handleIsUseNamedParameters()
132     */
133    public final boolean isUseNamedParameters()
134    {
135        boolean useNamedParameters1a = this.__useNamedParameters1a;
136        if (!this.__useNamedParameters1aSet)
137        {
138            // useNamedParameters has no pre constraints
139            useNamedParameters1a = handleIsUseNamedParameters();
140            // useNamedParameters has no post constraints
141            this.__useNamedParameters1a = useNamedParameters1a;
142            if (isMetafacadePropertyCachingEnabled())
143            {
144                this.__useNamedParameters1aSet = true;
145            }
146        }
147        return useNamedParameters1a;
148    }
149
150   /**
151    * @see org.andromda.cartridges.hibernate.metafacades.HibernateFinderMethod#getQuery()
152    * @return String
153    */
154    protected abstract String handleGetQuery();
155
156    private String __query2a;
157    private boolean __query2aSet = false;
158
159    /**
160     * The actual query returned for the body of the finder.
161     * @return (String)handleGetQuery()
162     */
163    public final String getQuery()
164    {
165        String query2a = this.__query2a;
166        if (!this.__query2aSet)
167        {
168            // query has no pre constraints
169            query2a = handleGetQuery();
170            // query has no post constraints
171            this.__query2a = query2a;
172            if (isMetafacadePropertyCachingEnabled())
173            {
174                this.__query2aSet = true;
175            }
176        }
177        return query2a;
178    }
179
180   /**
181    * @see org.andromda.cartridges.hibernate.metafacades.HibernateFinderMethod#isUseQueryCache()
182    * @return boolean
183    */
184    protected abstract boolean handleIsUseQueryCache();
185
186    private boolean __useQueryCache3a;
187    private boolean __useQueryCache3aSet = false;
188
189    /**
190     * Enables cache for the query.
191     * @return (boolean)handleIsUseQueryCache()
192     */
193    public final boolean isUseQueryCache()
194    {
195        boolean useQueryCache3a = this.__useQueryCache3a;
196        if (!this.__useQueryCache3aSet)
197        {
198            // useQueryCache has no pre constraints
199            useQueryCache3a = handleIsUseQueryCache();
200            // useQueryCache has no post constraints
201            this.__useQueryCache3a = useQueryCache3a;
202            if (isMetafacadePropertyCachingEnabled())
203            {
204                this.__useQueryCache3aSet = true;
205            }
206        }
207        return useQueryCache3a;
208    }
209
210    /**
211     * @return true
212     * @see EntityQueryOperation
213     */
214    public boolean isEntityQueryOperationMetaType()
215    {
216        return true;
217    }
218
219    /**
220     * @return true
221     * @see OperationFacade
222     */
223    public boolean isOperationFacadeMetaType()
224    {
225        return true;
226    }
227
228    /**
229     * @return true
230     * @see ModelElementFacade
231     */
232    public boolean isModelElementFacadeMetaType()
233    {
234        return true;
235    }
236
237    // ----------- delegates to EntityQueryOperation ------------
238    /**
239     * The query string for this EntityFinderMethod.  The query returned is based on the
240     * 'translation' passed in.  The translation must be one available to AndroMDA found with a
241     * translation-library.
242     * @see EntityQueryOperation#getQuery(String translation)
243     */
244    public String getQuery(String translation)
245    {
246        return this.getSuperEntityQueryOperation().getQuery(translation);
247    }
248
249    /**
250     * Copies all tagged values from the given ModelElementFacade to this model element facade.
251     * @see ModelElementFacade#copyTaggedValues(ModelElementFacade element)
252     */
253    public void copyTaggedValues(ModelElementFacade element)
254    {
255        this.getSuperEntityQueryOperation().copyTaggedValues(element);
256    }
257
258    /**
259     * Finds the tagged value with the specified 'tagName'. In case there are more values the first
260     * one found will be returned.
261     * @see ModelElementFacade#findTaggedValue(String tagName)
262     */
263    public Object findTaggedValue(String tagName)
264    {
265        return this.getSuperEntityQueryOperation().findTaggedValue(tagName);
266    }
267
268    /**
269     * Returns all the values for the tagged value with the specified name. The returned collection
270     * will contains only String instances, or will be empty. Never null.
271     * @see ModelElementFacade#findTaggedValues(String tagName)
272     */
273    public Collection<Object> findTaggedValues(String tagName)
274    {
275        return this.getSuperEntityQueryOperation().findTaggedValues(tagName);
276    }
277
278    /**
279     * Returns the fully qualified name of the model element. The fully qualified name includes
280     * complete package qualified name of the underlying model element. The templates parameter will
281     * be replaced by the correct one given the binding relation of the parameter to this element.
282     * @see ModelElementFacade#getBindedFullyQualifiedName(ModelElementFacade bindedElement)
283     */
284    public String getBindedFullyQualifiedName(ModelElementFacade bindedElement)
285    {
286        return this.getSuperEntityQueryOperation().getBindedFullyQualifiedName(bindedElement);
287    }
288
289    /**
290     * Gets all constraints belonging to the model element.
291     * @see ModelElementFacade#getConstraints()
292     */
293    public Collection<ConstraintFacade> getConstraints()
294    {
295        return this.getSuperEntityQueryOperation().getConstraints();
296    }
297
298    /**
299     * Returns the constraints of the argument kind that have been placed onto this model. Typical
300     * kinds are "inv", "pre" and "post". Other kinds are possible.
301     * @see ModelElementFacade#getConstraints(String kind)
302     */
303    public Collection<ConstraintFacade> getConstraints(String kind)
304    {
305        return this.getSuperEntityQueryOperation().getConstraints(kind);
306    }
307
308    /**
309     * Gets the documentation for the model element, The indent argument is prefixed to each line.
310     * By default this method wraps lines after 64 characters.
311     * This method is equivalent to <code>getDocumentation(indent, 64)</code>.
312     * @see ModelElementFacade#getDocumentation(String indent)
313     */
314    public String getDocumentation(String indent)
315    {
316        return this.getSuperEntityQueryOperation().getDocumentation(indent);
317    }
318
319    /**
320     * This method returns the documentation for this model element, with the lines wrapped after
321     * the specified number of characters, values of less than 1 will indicate no line wrapping is
322     * required. By default paragraphs are returned as HTML.
323     * This method is equivalent to <code>getDocumentation(indent, lineLength, true)</code>.
324     * @see ModelElementFacade#getDocumentation(String indent, int lineLength)
325     */
326    public String getDocumentation(String indent, int lineLength)
327    {
328        return this.getSuperEntityQueryOperation().getDocumentation(indent, lineLength);
329    }
330
331    /**
332     * This method returns the documentation for this model element, with the lines wrapped after
333     * the specified number of characters, values of less than 1 will indicate no line wrapping is
334     * required. HTML style determines if HTML Escaping is applied.
335     * @see ModelElementFacade#getDocumentation(String indent, int lineLength, boolean htmlStyle)
336     */
337    public String getDocumentation(String indent, int lineLength, boolean htmlStyle)
338    {
339        return this.getSuperEntityQueryOperation().getDocumentation(indent, lineLength, htmlStyle);
340    }
341
342    /**
343     * The fully qualified name of this model element.
344     * @see ModelElementFacade#getFullyQualifiedName()
345     */
346    public String getFullyQualifiedName()
347    {
348        return this.getSuperEntityQueryOperation().getFullyQualifiedName();
349    }
350
351    /**
352     * Returns the fully qualified name of the model element. The fully qualified name includes
353     * complete package qualified name of the underlying model element.  If modelName is true, then
354     * the original name of the model element (the name contained within the model) will be the name
355     * returned, otherwise a name from a language mapping will be returned.
356     * @see ModelElementFacade#getFullyQualifiedName(boolean modelName)
357     */
358    public String getFullyQualifiedName(boolean modelName)
359    {
360        return this.getSuperEntityQueryOperation().getFullyQualifiedName(modelName);
361    }
362
363    /**
364     * Returns the fully qualified name as a path, the returned value always starts with out a slash
365     * '/'.
366     * @see ModelElementFacade#getFullyQualifiedNamePath()
367     */
368    public String getFullyQualifiedNamePath()
369    {
370        return this.getSuperEntityQueryOperation().getFullyQualifiedNamePath();
371    }
372
373    /**
374     * Gets the unique identifier of the underlying model element.
375     * @see ModelElementFacade#getId()
376     */
377    public String getId()
378    {
379        return this.getSuperEntityQueryOperation().getId();
380    }
381
382    /**
383     * UML2: Retrieves the keywords for this element. Used to modify implementation properties which
384     * are not represented by other properties, i.e. native, transient, volatile, synchronized,
385     * (added annotations) override, deprecated. Can also be used to suppress compiler warnings:
386     * (added annotations) unchecked, fallthrough, path, serial, finally, all. Annotations require
387     * JDK5 compiler level.
388     * @see ModelElementFacade#getKeywords()
389     */
390    public Collection<String> getKeywords()
391    {
392        return this.getSuperEntityQueryOperation().getKeywords();
393    }
394
395    /**
396     * UML2: Retrieves a localized label for this named element.
397     * @see ModelElementFacade#getLabel()
398     */
399    public String getLabel()
400    {
401        return this.getSuperEntityQueryOperation().getLabel();
402    }
403
404    /**
405     * The language mappings that have been set for this model element.
406     * @see ModelElementFacade#getLanguageMappings()
407     */
408    public TypeMappings getLanguageMappings()
409    {
410        return this.getSuperEntityQueryOperation().getLanguageMappings();
411    }
412
413    /**
414     * Return the model containing this model element (multiple models may be loaded and processed
415     * at the same time).
416     * @see ModelElementFacade#getModel()
417     */
418    public ModelFacade getModel()
419    {
420        return this.getSuperEntityQueryOperation().getModel();
421    }
422
423    /**
424     * The name of the model element.
425     * @see ModelElementFacade#getName()
426     */
427    public String getName()
428    {
429        return this.getSuperEntityQueryOperation().getName();
430    }
431
432    /**
433     * Gets the package to which this model element belongs.
434     * @see ModelElementFacade#getPackage()
435     */
436    public ModelElementFacade getPackage()
437    {
438        return this.getSuperEntityQueryOperation().getPackage();
439    }
440
441    /**
442     * The name of this model element's package.
443     * @see ModelElementFacade#getPackageName()
444     */
445    public String getPackageName()
446    {
447        return this.getSuperEntityQueryOperation().getPackageName();
448    }
449
450    /**
451     * Gets the package name (optionally providing the ability to retrieve the model name and not
452     * the mapped name).
453     * @see ModelElementFacade#getPackageName(boolean modelName)
454     */
455    public String getPackageName(boolean modelName)
456    {
457        return this.getSuperEntityQueryOperation().getPackageName(modelName);
458    }
459
460    /**
461     * Returns the package as a path, the returned value always starts with out a slash '/'.
462     * @see ModelElementFacade#getPackagePath()
463     */
464    public String getPackagePath()
465    {
466        return this.getSuperEntityQueryOperation().getPackagePath();
467    }
468
469    /**
470     * UML2: Returns the value of the 'Qualified Name' attribute. A name which allows the
471     * NamedElement to be identified within a hierarchy of nested Namespaces. It is constructed from
472     * the names of the containing namespaces starting at the root of the hierarchy and ending with
473     * the name of the NamedElement itself.
474     * @see ModelElementFacade#getQualifiedName()
475     */
476    public String getQualifiedName()
477    {
478        return this.getSuperEntityQueryOperation().getQualifiedName();
479    }
480
481    /**
482     * Gets the root package for the model element.
483     * @see ModelElementFacade#getRootPackage()
484     */
485    public PackageFacade getRootPackage()
486    {
487        return this.getSuperEntityQueryOperation().getRootPackage();
488    }
489
490    /**
491     * Gets the dependencies for which this model element is the source.
492     * @see ModelElementFacade#getSourceDependencies()
493     */
494    public Collection<DependencyFacade> getSourceDependencies()
495    {
496        return this.getSuperEntityQueryOperation().getSourceDependencies();
497    }
498
499    /**
500     * If this model element is the context of an activity graph, this represents that activity
501     * graph.
502     * @see ModelElementFacade#getStateMachineContext()
503     */
504    public StateMachineFacade getStateMachineContext()
505    {
506        return this.getSuperEntityQueryOperation().getStateMachineContext();
507    }
508
509    /**
510     * The collection of ALL stereotype names for this model element.
511     * @see ModelElementFacade#getStereotypeNames()
512     */
513    public Collection<String> getStereotypeNames()
514    {
515        return this.getSuperEntityQueryOperation().getStereotypeNames();
516    }
517
518    /**
519     * Gets all stereotypes for this model element.
520     * @see ModelElementFacade#getStereotypes()
521     */
522    public Collection<StereotypeFacade> getStereotypes()
523    {
524        return this.getSuperEntityQueryOperation().getStereotypes();
525    }
526
527    /**
528     * Return the TaggedValues associated with this model element, under all stereotypes.
529     * @see ModelElementFacade#getTaggedValues()
530     */
531    public Collection<TaggedValueFacade> getTaggedValues()
532    {
533        return this.getSuperEntityQueryOperation().getTaggedValues();
534    }
535
536    /**
537     * Gets the dependencies for which this model element is the target.
538     * @see ModelElementFacade#getTargetDependencies()
539     */
540    public Collection<DependencyFacade> getTargetDependencies()
541    {
542        return this.getSuperEntityQueryOperation().getTargetDependencies();
543    }
544
545    /**
546     * Get the template parameter for this model element having the parameterName
547     * @see ModelElementFacade#getTemplateParameter(String parameterName)
548     */
549    public Object getTemplateParameter(String parameterName)
550    {
551        return this.getSuperEntityQueryOperation().getTemplateParameter(parameterName);
552    }
553
554    /**
555     * Get the template parameters for this model element
556     * @see ModelElementFacade#getTemplateParameters()
557     */
558    public Collection<TemplateParameterFacade> getTemplateParameters()
559    {
560        return this.getSuperEntityQueryOperation().getTemplateParameters();
561    }
562
563    /**
564     * The visibility (i.e. public, private, protected or package) of the model element, will
565     * attempt a lookup for these values in the language mappings (if any).
566     * @see ModelElementFacade#getVisibility()
567     */
568    public String getVisibility()
569    {
570        return this.getSuperEntityQueryOperation().getVisibility();
571    }
572
573    /**
574     * Returns true if the model element has the exact stereotype (meaning no stereotype inheritance
575     * is taken into account when searching for the stereotype), false otherwise.
576     * @see ModelElementFacade#hasExactStereotype(String stereotypeName)
577     */
578    public boolean hasExactStereotype(String stereotypeName)
579    {
580        return this.getSuperEntityQueryOperation().hasExactStereotype(stereotypeName);
581    }
582
583    /**
584     * Does the UML Element contain the named Keyword? Keywords can be separated by space, comma,
585     * pipe, semicolon, or << >>
586     * @see ModelElementFacade#hasKeyword(String keywordName)
587     */
588    public boolean hasKeyword(String keywordName)
589    {
590        return this.getSuperEntityQueryOperation().hasKeyword(keywordName);
591    }
592
593    /**
594     * Returns true if the model element has the specified stereotype.  If the stereotype itself
595     * does not match, then a search will be made up the stereotype inheritance hierarchy, and if
596     * one of the stereotype's ancestors has a matching name this method will return true, false
597     * otherwise.
598     * For example, if we have a certain stereotype called <<exception>> and a model element has a
599     * stereotype called <<applicationException>> which extends <<exception>>, when calling this
600     * method with 'stereotypeName' defined as 'exception' the method would return true since
601     * <<applicationException>> inherits from <<exception>>.  If you want to check if the model
602     * element has the exact stereotype, then use the method 'hasExactStereotype' instead.
603     * @see ModelElementFacade#hasStereotype(String stereotypeName)
604     */
605    public boolean hasStereotype(String stereotypeName)
606    {
607        return this.getSuperEntityQueryOperation().hasStereotype(stereotypeName);
608    }
609
610    /**
611     * True if there are target dependencies from this element that are instances of BindingFacade.
612     * Deprecated in UML2: Use TemplateBinding parameters instead of dependencies.
613     * @see ModelElementFacade#isBindingDependenciesPresent()
614     */
615    public boolean isBindingDependenciesPresent()
616    {
617        return this.getSuperEntityQueryOperation().isBindingDependenciesPresent();
618    }
619
620    /**
621     * Indicates if any constraints are present on this model element.
622     * @see ModelElementFacade#isConstraintsPresent()
623     */
624    public boolean isConstraintsPresent()
625    {
626        return this.getSuperEntityQueryOperation().isConstraintsPresent();
627    }
628
629    /**
630     * Indicates if any documentation is present on this model element.
631     * @see ModelElementFacade#isDocumentationPresent()
632     */
633    public boolean isDocumentationPresent()
634    {
635        return this.getSuperEntityQueryOperation().isDocumentationPresent();
636    }
637
638    /**
639     * True if this element name is a reserved word in Java, C#, ANSI or ISO C, C++, JavaScript.
640     * @see ModelElementFacade#isReservedWord()
641     */
642    public boolean isReservedWord()
643    {
644        return this.getSuperEntityQueryOperation().isReservedWord();
645    }
646
647    /**
648     * True is there are template parameters on this model element. For UML2, applies to Class,
649     * Operation, Property, and Parameter.
650     * @see ModelElementFacade#isTemplateParametersPresent()
651     */
652    public boolean isTemplateParametersPresent()
653    {
654        return this.getSuperEntityQueryOperation().isTemplateParametersPresent();
655    }
656
657    /**
658     * True if this element name is a valid identifier name in Java, C#, ANSI or ISO C, C++,
659     * JavaScript. Contains no spaces, special characters etc. Constraint always applied on
660     * Enumerations and Interfaces, optionally applies on other model elements.
661     * @see ModelElementFacade#isValidIdentifierName()
662     */
663    public boolean isValidIdentifierName()
664    {
665        return this.getSuperEntityQueryOperation().isValidIdentifierName();
666    }
667
668    /**
669     * Searches for the constraint with the specified 'name' on this model element, and if found
670     * translates it using the specified 'translation' from a translation library discovered by the
671     * framework.
672     * @see ModelElementFacade#translateConstraint(String name, String translation)
673     */
674    public String translateConstraint(String name, String translation)
675    {
676        return this.getSuperEntityQueryOperation().translateConstraint(name, translation);
677    }
678
679    /**
680     * Translates all constraints belonging to this model element with the given 'translation'.
681     * @see ModelElementFacade#translateConstraints(String translation)
682     */
683    public String[] translateConstraints(String translation)
684    {
685        return this.getSuperEntityQueryOperation().translateConstraints(translation);
686    }
687
688    /**
689     * Translates the constraints of the specified 'kind' belonging to this model element.
690     * @see ModelElementFacade#translateConstraints(String kind, String translation)
691     */
692    public String[] translateConstraints(String kind, String translation)
693    {
694        return this.getSuperEntityQueryOperation().translateConstraints(kind, translation);
695    }
696
697    /**
698     * Finds the parameter on this operation having the given name, if no parameter is found, null
699     * is returned instead.
700     * @see OperationFacade#findParameter(String name)
701     */
702    public ParameterFacade findParameter(String name)
703    {
704        return this.getSuperEntityQueryOperation().findParameter(name);
705    }
706
707    /**
708     * Searches the given feature for the specified tag.
709     * If the follow boolean is set to true then the search will continue from the class operation
710     * to the class itself and then up the class hierarchy.
711     * @see OperationFacade#findTaggedValue(String name, boolean follow)
712     */
713    public Object findTaggedValue(String name, boolean follow)
714    {
715        return this.getSuperEntityQueryOperation().findTaggedValue(name, follow);
716    }
717
718    /**
719     * A comma separated list of all argument names.
720     * @see OperationFacade#getArgumentNames()
721     */
722    public String getArgumentNames()
723    {
724        return this.getSuperEntityQueryOperation().getArgumentNames();
725    }
726
727    /**
728     * A comma separated list of all types of each argument, in order.
729     * @see OperationFacade#getArgumentTypeNames()
730     */
731    public String getArgumentTypeNames()
732    {
733        return this.getSuperEntityQueryOperation().getArgumentTypeNames();
734    }
735
736    /**
737     * Specification of an argument used to pass information into or out of an invocation of a
738     * behavioral
739     * feature. Parameters are allowed to be treated as connectable elements. Parameters have
740     * support for
741     * streaming, exceptions, and parameter sets.
742     * @see OperationFacade#getArguments()
743     */
744    public Collection<ParameterFacade> getArguments()
745    {
746        return this.getSuperEntityQueryOperation().getArguments();
747    }
748
749    /**
750     * Constructs the operation call with the operation name
751     * @see OperationFacade#getCall()
752     */
753    public String getCall()
754    {
755        return this.getSuperEntityQueryOperation().getCall();
756    }
757
758    /**
759     * Returns the concurrency modifier for this operation (i.e. concurrent, guarded or sequential)
760     * of the model element, will attempt a lookup for these values in the language mappings (if
761     * any).
762     * @see OperationFacade#getConcurrency()
763     */
764    public String getConcurrency()
765    {
766        return this.getSuperEntityQueryOperation().getConcurrency();
767    }
768
769    /**
770     * A comma separated list containing all exceptions that this operation throws.  Exceptions are
771     * determined through dependencies that have the target element stereotyped as <<Exception>>.
772     * @see OperationFacade#getExceptionList()
773     */
774    public String getExceptionList()
775    {
776        return this.getSuperEntityQueryOperation().getExceptionList();
777    }
778
779    /**
780     * Returns a comma separated list of exceptions appended to the comma separated list of fully
781     * qualified 'initialException' classes passed in to this method.
782     * @see OperationFacade#getExceptionList(String initialExceptions)
783     */
784    public String getExceptionList(String initialExceptions)
785    {
786        return this.getSuperEntityQueryOperation().getExceptionList(initialExceptions);
787    }
788
789    /**
790     * A collection of all exceptions thrown by this operation.
791     * @see OperationFacade#getExceptions()
792     */
793    public Collection<ModelElementFacade> getExceptions()
794    {
795        return this.getSuperEntityQueryOperation().getExceptions();
796    }
797
798    /**
799     * Return Type with multiplicity taken into account. UML14 does not allow multiplicity *.
800     * @see OperationFacade#getGetterSetterReturnTypeName()
801     */
802    public String getGetterSetterReturnTypeName()
803    {
804        return this.getSuperEntityQueryOperation().getGetterSetterReturnTypeName();
805    }
806
807    /**
808     * the lower value for the multiplicity
809     * -only applicable for UML2
810     * @see OperationFacade#getLower()
811     */
812    public int getLower()
813    {
814        return this.getSuperEntityQueryOperation().getLower();
815    }
816
817    /**
818     * Returns the operation method body determined from UML sequence diagrams or other UML sources.
819     * @see OperationFacade#getMethodBody()
820     */
821    public String getMethodBody()
822    {
823        return this.getSuperEntityQueryOperation().getMethodBody();
824    }
825
826    /**
827     * The operation this operation overrides, null if this operation is not overriding.
828     * @see OperationFacade#getOverriddenOperation()
829     */
830    public OperationFacade getOverriddenOperation()
831    {
832        return this.getSuperEntityQueryOperation().getOverriddenOperation();
833    }
834
835    /**
836     * Gets the owner of this operation
837     * @see OperationFacade#getOwner()
838     */
839    public ClassifierFacade getOwner()
840    {
841        return this.getSuperEntityQueryOperation().getOwner();
842    }
843
844    /**
845     * Return all parameters for the operation, including the return parameter.
846     * @see OperationFacade#getParameters()
847     */
848    public Collection<ParameterFacade> getParameters()
849    {
850        return this.getSuperEntityQueryOperation().getParameters();
851    }
852
853    /**
854     * The name of the operation that handles postcondition constraints.
855     * @see OperationFacade#getPostconditionName()
856     */
857    public String getPostconditionName()
858    {
859        return this.getSuperEntityQueryOperation().getPostconditionName();
860    }
861
862    /**
863     * The postcondition constraints belonging to this operation.
864     * @see OperationFacade#getPostconditions()
865     */
866    public Collection<ConstraintFacade> getPostconditions()
867    {
868        return this.getSuperEntityQueryOperation().getPostconditions();
869    }
870
871    /**
872     * The call to the precondition operation.
873     * @see OperationFacade#getPreconditionCall()
874     */
875    public String getPreconditionCall()
876    {
877        return this.getSuperEntityQueryOperation().getPreconditionCall();
878    }
879
880    /**
881     * The name of the operation that handles precondition constraints.
882     * @see OperationFacade#getPreconditionName()
883     */
884    public String getPreconditionName()
885    {
886        return this.getSuperEntityQueryOperation().getPreconditionName();
887    }
888
889    /**
890     * The signature of the precondition operation.
891     * @see OperationFacade#getPreconditionSignature()
892     */
893    public String getPreconditionSignature()
894    {
895        return this.getSuperEntityQueryOperation().getPreconditionSignature();
896    }
897
898    /**
899     * The precondition constraints belonging to this operation.
900     * @see OperationFacade#getPreconditions()
901     */
902    public Collection<ConstraintFacade> getPreconditions()
903    {
904        return this.getSuperEntityQueryOperation().getPreconditions();
905    }
906
907    /**
908     * (UML2 Only). Get the actual return parameter (which may have stereotypes etc).
909     * @see OperationFacade#getReturnParameter()
910     */
911    public ParameterFacade getReturnParameter()
912    {
913        return this.getSuperEntityQueryOperation().getReturnParameter();
914    }
915
916    /**
917     * The operation return type parameter.
918     * @see OperationFacade#getReturnType()
919     */
920    public ClassifierFacade getReturnType()
921    {
922        return this.getSuperEntityQueryOperation().getReturnType();
923    }
924
925    /**
926     * Return the operation signature, including public/protested abstract returnType name plus
927     * argument type and name
928     * @see OperationFacade#getSignature()
929     */
930    public String getSignature()
931    {
932        return this.getSuperEntityQueryOperation().getSignature();
933    }
934
935    /**
936     * Returns the signature of the operation and optionally appends the argument names (if
937     * withArgumentNames is true), otherwise returns the signature with just the types alone in the
938     * signature.
939     * @see OperationFacade#getSignature(boolean withArgumentNames)
940     */
941    public String getSignature(boolean withArgumentNames)
942    {
943        return this.getSuperEntityQueryOperation().getSignature(withArgumentNames);
944    }
945
946    /**
947     * Returns the signature of the operation and optionally appends the given 'argumentModifier' to
948     * each argument.
949     * @see OperationFacade#getSignature(String argumentModifier)
950     */
951    public String getSignature(String argumentModifier)
952    {
953        return this.getSuperEntityQueryOperation().getSignature(argumentModifier);
954    }
955
956    /**
957     * A comma-separated parameter list  (type and name of each parameter) of an operation.
958     * @see OperationFacade#getTypedArgumentList()
959     */
960    public String getTypedArgumentList()
961    {
962        return this.getSuperEntityQueryOperation().getTypedArgumentList();
963    }
964
965    /**
966     * A comma-separated parameter list  (type and name of each parameter) of an operation with an
967     * optional modifier (i.e final) before each parameter.
968     * @see OperationFacade#getTypedArgumentList(String modifier)
969     */
970    public String getTypedArgumentList(String modifier)
971    {
972        return this.getSuperEntityQueryOperation().getTypedArgumentList(modifier);
973    }
974
975    /**
976     * the upper value for the multiplicity (will be -1 for *)
977     * - only applicable for UML2
978     * @see OperationFacade#getUpper()
979     */
980    public int getUpper()
981    {
982        return this.getSuperEntityQueryOperation().getUpper();
983    }
984
985    /**
986     * True is the operation is abstract.
987     * @see OperationFacade#isAbstract()
988     */
989    public boolean isAbstract()
990    {
991        return this.getSuperEntityQueryOperation().isAbstract();
992    }
993
994    /**
995     * True if the operation has (i.e. throws any exceptions) false otherwise.
996     * @see OperationFacade#isExceptionsPresent()
997     */
998    public boolean isExceptionsPresent()
999    {
1000        return this.getSuperEntityQueryOperation().isExceptionsPresent();
1001    }
1002
1003    /**
1004     * IsLeaf property in the operation. If true, operation is final, cannot be extended or
1005     * implemented by a descendant. Default=false.
1006     * @see OperationFacade#isLeaf()
1007     */
1008    public boolean isLeaf()
1009    {
1010        return this.getSuperEntityQueryOperation().isLeaf();
1011    }
1012
1013    /**
1014     * UML2 only. If the return type parameter multiplicity>1 OR the operation multiplicity>1.
1015     * Default=false.
1016     * @see OperationFacade#isMany()
1017     */
1018    public boolean isMany()
1019    {
1020        return this.getSuperEntityQueryOperation().isMany();
1021    }
1022
1023    /**
1024     * UML2 only: If isMany (Collection type returned), is the type unique within the collection. 
1025     * Unique+Ordered determines CollectionType implementation of return result. Default=false.
1026     * @see OperationFacade#isOrdered()
1027     */
1028    public boolean isOrdered()
1029    {
1030        return this.getSuperEntityQueryOperation().isOrdered();
1031    }
1032
1033    /**
1034     * True if this operation overrides an operation defined in an ancestor class. An operation
1035     * overrides when the names of the operations as well as the types of the arguments are equal.
1036     * The return type may be different and is, as well as any exceptions, ignored.
1037     * @see OperationFacade#isOverriding()
1038     */
1039    public boolean isOverriding()
1040    {
1041        return this.getSuperEntityQueryOperation().isOverriding();
1042    }
1043
1044    /**
1045     * Whether any postcondition constraints are present on this operation.
1046     * @see OperationFacade#isPostconditionsPresent()
1047     */
1048    public boolean isPostconditionsPresent()
1049    {
1050        return this.getSuperEntityQueryOperation().isPostconditionsPresent();
1051    }
1052
1053    /**
1054     * Whether any precondition constraints are present on this operation.
1055     * @see OperationFacade#isPreconditionsPresent()
1056     */
1057    public boolean isPreconditionsPresent()
1058    {
1059        return this.getSuperEntityQueryOperation().isPreconditionsPresent();
1060    }
1061
1062    /**
1063     * Indicates whether or not this operation is a query operation.
1064     * @see OperationFacade#isQuery()
1065     */
1066    public boolean isQuery()
1067    {
1068        return this.getSuperEntityQueryOperation().isQuery();
1069    }
1070
1071    /**
1072     * True/false depending on whether or not the operation has a return type or not (i.e. a return
1073     * type of something other than void).
1074     * @see OperationFacade#isReturnTypePresent()
1075     */
1076    public boolean isReturnTypePresent()
1077    {
1078        return this.getSuperEntityQueryOperation().isReturnTypePresent();
1079    }
1080
1081    /**
1082     * True is the operation is static (only a single instance can be instantiated).
1083     * @see OperationFacade#isStatic()
1084     */
1085    public boolean isStatic()
1086    {
1087        return this.getSuperEntityQueryOperation().isStatic();
1088    }
1089
1090    /**
1091     * UML2 only: for Collection return type, is the type unique within the collection.
1092     * Unique+Ordered determines the returned CollectionType. Default=false.
1093     * @see OperationFacade#isUnique()
1094     */
1095    public boolean isUnique()
1096    {
1097        return this.getSuperEntityQueryOperation().isUnique();
1098    }
1099
1100    /**
1101     * @see org.andromda.core.metafacade.MetafacadeBase#initialize()
1102     */
1103    @Override
1104    public void initialize()
1105    {
1106        this.getSuperEntityQueryOperation().initialize();
1107    }
1108
1109    /**
1110     * @return Object getSuperEntityQueryOperation().getValidationOwner()
1111     * @see org.andromda.core.metafacade.MetafacadeBase#getValidationOwner()
1112     */
1113    @Override
1114    public Object getValidationOwner()
1115    {
1116        Object owner = this.getSuperEntityQueryOperation().getValidationOwner();
1117        return owner;
1118    }
1119
1120    /**
1121     * @return String getSuperEntityQueryOperation().getValidationName()
1122     * @see org.andromda.core.metafacade.MetafacadeBase#getValidationName()
1123     */
1124    @Override
1125    public String getValidationName()
1126    {
1127        String name = this.getSuperEntityQueryOperation().getValidationName();
1128        return name;
1129    }
1130
1131    /**
1132     * @param validationMessages Collection<ModelValidationMessage>
1133     * @see org.andromda.core.metafacade.MetafacadeBase#validateInvariants(Collection validationMessages)
1134     */
1135    @Override
1136    public void validateInvariants(Collection<ModelValidationMessage> validationMessages)
1137    {
1138        this.getSuperEntityQueryOperation().validateInvariants(validationMessages);
1139    }
1140
1141    /**
1142     * The property that stores the name of the metafacade.
1143     */
1144    private static final String NAME_PROPERTY = "name";
1145    private static final String FQNAME_PROPERTY = "fullyQualifiedName";
1146
1147    /**
1148     * @see Object#toString()
1149     */
1150    @Override
1151    public String toString()
1152    {
1153        final StringBuilder toString = new StringBuilder(this.getClass().getName());
1154        toString.append("[");
1155        try
1156        {
1157            toString.append(Introspector.instance().getProperty(this, FQNAME_PROPERTY));
1158        }
1159        catch (final Throwable tryAgain)
1160        {
1161            try
1162            {
1163                toString.append(Introspector.instance().getProperty(this, NAME_PROPERTY));
1164            }
1165            catch (final Throwable ignore)
1166            {
1167                // - just ignore when the metafacade doesn't have a name or fullyQualifiedName property
1168            }
1169        }
1170        toString.append("]");
1171        return toString.toString();
1172    }
1173}