View Javadoc
1   // license-header java merge-point
2   //
3   // Attention: generated code (by MetafacadeLogic.vsl) - do not modify!
4   //
5   package org.andromda.cartridges.ejb.metafacades;
6   
7   import java.util.Collection;
8   import org.andromda.core.metafacade.ModelValidationMessage;
9   
10  /**
11   * TODO: Model Documentation for org.andromda.cartridges.ejb.metafacades.EJBPrimaryKeyFacade
12   * MetafacadeLogic for EJBPrimaryKeyFacade
13   *
14   * @see EJBPrimaryKeyFacade
15   */
16  public abstract class EJBPrimaryKeyFacadeLogic
17      extends EJBEntityAttributeFacadeLogicImpl
18      implements EJBPrimaryKeyFacade
19  {
20      /**
21       * The underlying UML object
22       * @see Object
23       */
24      protected Object metaObject;
25  
26      /** Create Metafacade implementation instance using the MetafacadeFactory from the context
27       * @param metaObjectIn
28       * @param context
29       */
30      protected EJBPrimaryKeyFacadeLogic(Object metaObjectIn, String context)
31      {
32          super(metaObjectIn, getContext(context));
33          this.metaObject = metaObjectIn;
34      }
35  
36      /**
37       * Gets the context for this metafacade logic instance.
38       * @param context String. Set to EJBPrimaryKeyFacade if null
39       * @return context String
40       */
41      private static String getContext(String context)
42      {
43          if (context == null)
44          {
45              context = "org.andromda.cartridges.ejb.metafacades.EJBPrimaryKeyFacade";
46          }
47          return context;
48      }
49  
50      /** Reset context only for non-root metafacades
51       * @param context
52       */
53      @Override
54      public void resetMetafacadeContext(String context)
55      {
56          if (!this.contextRoot) // reset context only for non-root metafacades
57          {
58              context = getContext(context);  // to have same value as in original constructor call
59              setMetafacadeContext (context);
60          }
61      }
62  
63      /**
64       * @return boolean true always
65       * @see EJBPrimaryKeyFacade
66       */
67      public boolean isEJBPrimaryKeyFacadeMetaType()
68      {
69          return true;
70      }
71  
72      // --------------- attributes ---------------------
73  
74     /**
75      * @see org.andromda.cartridges.ejb.metafacades.EJBPrimaryKeyFacade#isComplex()
76      * @return boolean
77      */
78      protected abstract boolean handleIsComplex();
79  
80      private boolean __complex1a;
81      private boolean __complex1aSet = false;
82  
83      /**
84       * True/false on whether or not the primary key is complex.
85       * @return (boolean)handleIsComplex()
86       */
87      public final boolean isComplex()
88      {
89          boolean complex1a = this.__complex1a;
90          if (!this.__complex1aSet)
91          {
92              // complex has no pre constraints
93              complex1a = handleIsComplex();
94              // complex has no post constraints
95              this.__complex1a = complex1a;
96              if (isMetafacadePropertyCachingEnabled())
97              {
98                  this.__complex1aSet = true;
99              }
100         }
101         return complex1a;
102     }
103 
104     /**
105      * @param validationMessages Collection<ModelValidationMessage>
106      * @see EJBEntityAttributeFacadeLogicImpl#validateInvariants(Collection validationMessages)
107      */
108     @Override
109     public void validateInvariants(Collection<ModelValidationMessage> validationMessages)
110     {
111         super.validateInvariants(validationMessages);
112     }
113 }