View Javadoc
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.EntityAssociation;
10  import org.omg.uml.foundation.core.UmlAssociation;
11  
12  /**
13   * Represents an association between entities.
14   * MetafacadeLogic for EntityAssociation
15   *
16   * @see EntityAssociation
17   */
18  public abstract class EntityAssociationLogic
19      extends AssociationFacadeLogicImpl
20      implements EntityAssociation
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 EntityAssociationLogic(Object metaObjectIn, String context)
33      {
34          super((UmlAssociation)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 EntityAssociation 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.EntityAssociation";
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 EntityAssociation
68       */
69      public boolean isEntityAssociationMetaType()
70      {
71          return true;
72      }
73  
74      // --------------- attributes ---------------------
75  
76     /**
77      * @see EntityAssociation#getTableName()
78      * @return String
79      */
80      protected abstract String handleGetTableName();
81  
82      private String __tableName1a;
83      private boolean __tableName1aSet = false;
84  
85      /**
86       * The name of the table if this is a many-to-many association.  Otherwise it just returns null
87       * if not part of a many-to-many association.
88       * @return (String)handleGetTableName()
89       */
90      public final String getTableName()
91      {
92          String tableName1a = this.__tableName1a;
93          if (!this.__tableName1aSet)
94          {
95              // tableName has no pre constraints
96              tableName1a = handleGetTableName();
97              // tableName has no post constraints
98              this.__tableName1a = tableName1a;
99              if (isMetafacadePropertyCachingEnabled())
100             {
101                 this.__tableName1aSet = true;
102             }
103         }
104         return tableName1a;
105     }
106 
107    /**
108     * @see EntityAssociation#getSchema()
109     * @return String
110     */
111     protected abstract String handleGetSchema();
112 
113     private String __schema2a;
114     private boolean __schema2aSet = false;
115 
116     /**
117      * The name of the schema that contains the database table
118      * @return (String)handleGetSchema()
119      */
120     public final String getSchema()
121     {
122         String schema2a = this.__schema2a;
123         if (!this.__schema2aSet)
124         {
125             // schema has no pre constraints
126             schema2a = handleGetSchema();
127             // schema has no post constraints
128             this.__schema2a = schema2a;
129             if (isMetafacadePropertyCachingEnabled())
130             {
131                 this.__schema2aSet = true;
132             }
133         }
134         return schema2a;
135     }
136 
137    /**
138     * @see EntityAssociation#isEntityAssociation()
139     * @return boolean
140     */
141     protected abstract boolean handleIsEntityAssociation();
142 
143     private boolean __entityAssociation3a;
144     private boolean __entityAssociation3aSet = false;
145 
146     /**
147      * is this an EntityAssociation?
148      * @return (boolean)handleIsEntityAssociation()
149      */
150     public final boolean isEntityAssociation()
151     {
152         boolean entityAssociation3a = this.__entityAssociation3a;
153         if (!this.__entityAssociation3aSet)
154         {
155             // entityAssociation has no pre constraints
156             entityAssociation3a = handleIsEntityAssociation();
157             // entityAssociation has no post constraints
158             this.__entityAssociation3a = entityAssociation3a;
159             if (isMetafacadePropertyCachingEnabled())
160             {
161                 this.__entityAssociation3aSet = true;
162             }
163         }
164         return entityAssociation3a;
165     }
166 
167     /**
168      * @param validationMessages Collection<ModelValidationMessage>
169      * @see AssociationFacadeLogicImpl#validateInvariants(Collection validationMessages)
170      */
171     @Override
172     public void validateInvariants(Collection<ModelValidationMessage> validationMessages)
173     {
174         super.validateInvariants(validationMessages);
175     }
176 }