1 // license-header java merge-point
2 //
3 // Attention: generated code (by MetafacadeLogic.vsl) - do not modify!
4 //
5 package org.andromda.metafacades.uml14;
6
7 import java.util.Collection;
8 import org.andromda.core.metafacade.ModelValidationMessage;
9 import org.andromda.metafacades.uml.EntityQueryOperation;
10 import org.omg.uml.foundation.core.Operation;
11
12 /**
13 * Represents a persistent entity finder method.
14 * MetafacadeLogic for EntityQueryOperation
15 *
16 * @see EntityQueryOperation
17 */
18 public abstract class EntityQueryOperationLogic
19 extends OperationFacadeLogicImpl
20 implements EntityQueryOperation
21 {
22 /**
23 * The underlying UML object
24 * @see Object
25 */
26 protected Object metaObject;
27
28 /** Create Metafacade implementation instance using the MetafacadeFactory from the context
29 * @param metaObjectIn
30 * @param context
31 */
32 protected EntityQueryOperationLogic(Object metaObjectIn, String context)
33 {
34 super((Operation)metaObjectIn, getContext(context));
35 this.metaObject = metaObjectIn;
36 }
37
38 /**
39 * Gets the context for this metafacade logic instance.
40 * @param context String. Set to EntityQueryOperation if null
41 * @return context String
42 */
43 private static String getContext(String context)
44 {
45 if (context == null)
46 {
47 context = "org.andromda.metafacades.uml.EntityQueryOperation";
48 }
49 return context;
50 }
51
52 /** Reset context only for non-root metafacades
53 * @param context
54 */
55 @Override
56 public void resetMetafacadeContext(String context)
57 {
58 if (!this.contextRoot) // reset context only for non-root metafacades
59 {
60 context = getContext(context); // to have same value as in original constructor call
61 setMetafacadeContext (context);
62 }
63 }
64
65 /**
66 * @return boolean true always
67 * @see EntityQueryOperation
68 */
69 public boolean isEntityQueryOperationMetaType()
70 {
71 return true;
72 }
73
74 // ---------------- business methods ----------------------
75
76 /**
77 * Method to be implemented in descendants
78 * The query string for this EntityFinderMethod. The query returned is based on the
79 * 'translation' passed in. The translation must be one available to AndroMDA found with a
80 * translation-library.
81 * @param translation
82 * @return String
83 */
84 protected abstract String handleGetQuery(String translation);
85
86 /**
87 * The query string for this EntityFinderMethod. The query returned is based on the
88 * 'translation' passed in. The translation must be one available to AndroMDA found with a
89 * translation-library.
90 * @param translation String
91 * TODO: Model Documentation for
92 * EntityQueryOperation.getQuery(translation)
93 * @return handleGetQuery(translation)
94 */
95 public String getQuery(String translation)
96 {
97 // getQuery has no pre constraints
98 String returnValue = handleGetQuery(translation);
99 // getQuery has no post constraints
100 return returnValue;
101 }
102
103 // ------------- associations ------------------
104
105 /**
106 * @param validationMessages Collection<ModelValidationMessage>
107 * @see OperationFacadeLogicImpl#validateInvariants(Collection validationMessages)
108 */
109 @Override
110 public void validateInvariants(Collection<ModelValidationMessage> validationMessages)
111 {
112 super.validateInvariants(validationMessages);
113 }
114 }