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.EntityAttribute;
10  import org.andromda.metafacades.uml.TypeMappings;
11  import org.omg.uml.foundation.core.Attribute;
12  
13  /**
14   * Represents an attribute of an entity.
15   * MetafacadeLogic for EntityAttribute
16   *
17   * @see EntityAttribute
18   */
19  public abstract class EntityAttributeLogic
20      extends AttributeFacadeLogicImpl
21      implements EntityAttribute
22  {
23      /**
24       * The underlying UML object
25       * @see Object
26       */
27      protected Object metaObject;
28  
29      /** Create Metafacade implementation instance using the MetafacadeFactory from the context
30       * @param metaObjectIn
31       * @param context
32       */
33      protected EntityAttributeLogic(Object metaObjectIn, String context)
34      {
35          super((Attribute)metaObjectIn, getContext(context));
36          this.metaObject = metaObjectIn;
37      }
38  
39      /**
40       * Gets the context for this metafacade logic instance.
41       * @param context String. Set to EntityAttribute if null
42       * @return context String
43       */
44      private static String getContext(String context)
45      {
46          if (context == null)
47          {
48              context = "org.andromda.metafacades.uml.EntityAttribute";
49          }
50          return context;
51      }
52  
53      /** Reset context only for non-root metafacades
54       * @param context
55       */
56      @Override
57      public void resetMetafacadeContext(String context)
58      {
59          if (!this.contextRoot) // reset context only for non-root metafacades
60          {
61              context = getContext(context);  // to have same value as in original constructor call
62              setMetafacadeContext (context);
63          }
64      }
65  
66      /**
67       * @return boolean true always
68       * @see EntityAttribute
69       */
70      public boolean isEntityAttributeMetaType()
71      {
72          return true;
73      }
74  
75      // --------------- attributes ---------------------
76  
77     /**
78      * @see EntityAttribute#getColumnLength()
79      * @return String
80      */
81      protected abstract String handleGetColumnLength();
82  
83      private String __columnLength1a;
84      private boolean __columnLength1aSet = false;
85  
86      /**
87       * The length of the column that persists this entity attribute.
88       * @return (String)handleGetColumnLength()
89       */
90      public final String getColumnLength()
91      {
92          String columnLength1a = this.__columnLength1a;
93          if (!this.__columnLength1aSet)
94          {
95              // columnLength has no pre constraints
96              columnLength1a = handleGetColumnLength();
97              // columnLength has no post constraints
98              this.__columnLength1a = columnLength1a;
99              if (isMetafacadePropertyCachingEnabled())
100             {
101                 this.__columnLength1aSet = true;
102             }
103         }
104         return columnLength1a;
105     }
106 
107    /**
108     * @see EntityAttribute#getColumnName()
109     * @return String
110     */
111     protected abstract String handleGetColumnName();
112 
113     private String __columnName2a;
114     private boolean __columnName2aSet = false;
115 
116     /**
117      * The name of the table column to which this entity is mapped.
118      * @return (String)handleGetColumnName()
119      */
120     public final String getColumnName()
121     {
122         String columnName2a = this.__columnName2a;
123         if (!this.__columnName2aSet)
124         {
125             // columnName has no pre constraints
126             columnName2a = handleGetColumnName();
127             // columnName has no post constraints
128             this.__columnName2a = columnName2a;
129             if (isMetafacadePropertyCachingEnabled())
130             {
131                 this.__columnName2aSet = true;
132             }
133         }
134         return columnName2a;
135     }
136 
137    /**
138     * @see EntityAttribute#getJdbcMappings()
139     * @return TypeMappings
140     */
141     protected abstract TypeMappings handleGetJdbcMappings();
142 
143     private TypeMappings __jdbcMappings3a;
144     private boolean __jdbcMappings3aSet = false;
145 
146     /**
147      * The PIM to language specific mappings for JDBC.
148      * @return (TypeMappings)handleGetJdbcMappings()
149      */
150     public final TypeMappings getJdbcMappings()
151     {
152         TypeMappings jdbcMappings3a = this.__jdbcMappings3a;
153         if (!this.__jdbcMappings3aSet)
154         {
155             // jdbcMappings has no pre constraints
156             jdbcMappings3a = handleGetJdbcMappings();
157             // jdbcMappings has no post constraints
158             this.__jdbcMappings3a = jdbcMappings3a;
159             if (isMetafacadePropertyCachingEnabled())
160             {
161                 this.__jdbcMappings3aSet = true;
162             }
163         }
164         return jdbcMappings3a;
165     }
166 
167    /**
168     * @see EntityAttribute#getJdbcType()
169     * @return String
170     */
171     protected abstract String handleGetJdbcType();
172 
173     private String __jdbcType4a;
174     private boolean __jdbcType4aSet = false;
175 
176     /**
177      * The JDBC type for this entity attribute.
178      * @return (String)handleGetJdbcType()
179      */
180     public final String getJdbcType()
181     {
182         String jdbcType4a = this.__jdbcType4a;
183         if (!this.__jdbcType4aSet)
184         {
185             // jdbcType has no pre constraints
186             jdbcType4a = handleGetJdbcType();
187             // jdbcType has no post constraints
188             this.__jdbcType4a = jdbcType4a;
189             if (isMetafacadePropertyCachingEnabled())
190             {
191                 this.__jdbcType4aSet = true;
192             }
193         }
194         return jdbcType4a;
195     }
196 
197    /**
198     * @see EntityAttribute#getSqlMappings()
199     * @return TypeMappings
200     */
201     protected abstract TypeMappings handleGetSqlMappings();
202 
203     private TypeMappings __sqlMappings5a;
204     private boolean __sqlMappings5aSet = false;
205 
206     /**
207      * The SQL mappings (i.e. the mappings which provide PIM to SQL mappings).
208      * @return (TypeMappings)handleGetSqlMappings()
209      */
210     public final TypeMappings getSqlMappings()
211     {
212         TypeMappings sqlMappings5a = this.__sqlMappings5a;
213         if (!this.__sqlMappings5aSet)
214         {
215             // sqlMappings has no pre constraints
216             sqlMappings5a = handleGetSqlMappings();
217             // sqlMappings has no post constraints
218             this.__sqlMappings5a = sqlMappings5a;
219             if (isMetafacadePropertyCachingEnabled())
220             {
221                 this.__sqlMappings5aSet = true;
222             }
223         }
224         return sqlMappings5a;
225     }
226 
227    /**
228     * @see EntityAttribute#getSqlType()
229     * @return String
230     */
231     protected abstract String handleGetSqlType();
232 
233     private String __sqlType6a;
234     private boolean __sqlType6aSet = false;
235 
236     /**
237      * The SQL type for this attribute.
238      * @return (String)handleGetSqlType()
239      */
240     public final String getSqlType()
241     {
242         String sqlType6a = this.__sqlType6a;
243         if (!this.__sqlType6aSet)
244         {
245             // sqlType has no pre constraints
246             sqlType6a = handleGetSqlType();
247             // sqlType has no post constraints
248             this.__sqlType6a = sqlType6a;
249             if (isMetafacadePropertyCachingEnabled())
250             {
251                 this.__sqlType6aSet = true;
252             }
253         }
254         return sqlType6a;
255     }
256 
257    /**
258     * @see EntityAttribute#isIdentifier()
259     * @return boolean
260     */
261     protected abstract boolean handleIsIdentifier();
262 
263     private boolean __identifier7a;
264     private boolean __identifier7aSet = false;
265 
266     /**
267      * True if this attribute is an identifier for its entity.
268      * @return (boolean)handleIsIdentifier()
269      */
270     public final boolean isIdentifier()
271     {
272         boolean identifier7a = this.__identifier7a;
273         if (!this.__identifier7aSet)
274         {
275             // identifier has no pre constraints
276             identifier7a = handleIsIdentifier();
277             // identifier has no post constraints
278             this.__identifier7a = identifier7a;
279             if (isMetafacadePropertyCachingEnabled())
280             {
281                 this.__identifier7aSet = true;
282             }
283         }
284         return identifier7a;
285     }
286 
287    /**
288     * @see EntityAttribute#getColumnIndex()
289     * @return String
290     */
291     protected abstract String handleGetColumnIndex();
292 
293     private String __columnIndex8a;
294     private boolean __columnIndex8aSet = false;
295 
296     /**
297      * The name of the index to create on a column that persists the entity attribute.
298      * @return (String)handleGetColumnIndex()
299      */
300     public final String getColumnIndex()
301     {
302         String columnIndex8a = this.__columnIndex8a;
303         if (!this.__columnIndex8aSet)
304         {
305             // columnIndex has no pre constraints
306             columnIndex8a = handleGetColumnIndex();
307             // columnIndex has no post constraints
308             this.__columnIndex8a = columnIndex8a;
309             if (isMetafacadePropertyCachingEnabled())
310             {
311                 this.__columnIndex8aSet = true;
312             }
313         }
314         return columnIndex8a;
315     }
316 
317    /**
318     * @see EntityAttribute#isTransient()
319     * @return boolean
320     */
321     protected abstract boolean handleIsTransient();
322 
323     private boolean __transient9a;
324     private boolean __transient9aSet = false;
325 
326     /**
327      * Indicates this attribute should be ignored by the persistence layer.
328      * @return (boolean)handleIsTransient()
329      */
330     public final boolean isTransient()
331     {
332         boolean transient9a = this.__transient9a;
333         if (!this.__transient9aSet)
334         {
335             // transient has no pre constraints
336             transient9a = handleIsTransient();
337             // transient has no post constraints
338             this.__transient9a = transient9a;
339             if (isMetafacadePropertyCachingEnabled())
340             {
341                 this.__transient9aSet = true;
342             }
343         }
344         return transient9a;
345     }
346 
347    /**
348     * @see EntityAttribute#getUniqueGroup()
349     * @return String
350     */
351     protected abstract String handleGetUniqueGroup();
352 
353     private String __uniqueGroup10a;
354     private boolean __uniqueGroup10aSet = false;
355 
356     /**
357      * The name of the unique-key that this unique attribute belongs
358      * @return (String)handleGetUniqueGroup()
359      */
360     public final String getUniqueGroup()
361     {
362         String uniqueGroup10a = this.__uniqueGroup10a;
363         if (!this.__uniqueGroup10aSet)
364         {
365             // uniqueGroup has no pre constraints
366             uniqueGroup10a = handleGetUniqueGroup();
367             // uniqueGroup has no post constraints
368             this.__uniqueGroup10a = uniqueGroup10a;
369             if (isMetafacadePropertyCachingEnabled())
370             {
371                 this.__uniqueGroup10aSet = true;
372             }
373         }
374         return uniqueGroup10a;
375     }
376 
377     // ------------- associations ------------------
378 
379     /**
380      * @param validationMessages Collection<ModelValidationMessage>
381      * @see AttributeFacadeLogicImpl#validateInvariants(Collection validationMessages)
382      */
383     @Override
384     public void validateInvariants(Collection<ModelValidationMessage> validationMessages)
385     {
386         super.validateInvariants(validationMessages);
387     }
388 }