EntityQueryOperationLogic.java

  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. import java.util.Collection;
  7. import org.andromda.core.metafacade.ModelValidationMessage;
  8. import org.andromda.metafacades.uml.EntityQueryOperation;
  9. import org.omg.uml.foundation.core.Operation;

  10. /**
  11.  * Represents a persistent entity finder method.
  12.  * MetafacadeLogic for EntityQueryOperation
  13.  *
  14.  * @see EntityQueryOperation
  15.  */
  16. public abstract class EntityQueryOperationLogic
  17.     extends OperationFacadeLogicImpl
  18.     implements EntityQueryOperation
  19. {
  20.     /**
  21.      * The underlying UML object
  22.      * @see Object
  23.      */
  24.     protected Object metaObject;

  25.     /** Create Metafacade implementation instance using the MetafacadeFactory from the context
  26.      * @param metaObjectIn
  27.      * @param context
  28.      */
  29.     protected EntityQueryOperationLogic(Object metaObjectIn, String context)
  30.     {
  31.         super((Operation)metaObjectIn, getContext(context));
  32.         this.metaObject = metaObjectIn;
  33.     }

  34.     /**
  35.      * Gets the context for this metafacade logic instance.
  36.      * @param context String. Set to EntityQueryOperation if null
  37.      * @return context String
  38.      */
  39.     private static String getContext(String context)
  40.     {
  41.         if (context == null)
  42.         {
  43.             context = "org.andromda.metafacades.uml.EntityQueryOperation";
  44.         }
  45.         return context;
  46.     }

  47.     /** Reset context only for non-root metafacades
  48.      * @param context
  49.      */
  50.     @Override
  51.     public void resetMetafacadeContext(String context)
  52.     {
  53.         if (!this.contextRoot) // reset context only for non-root metafacades
  54.         {
  55.             context = getContext(context);  // to have same value as in original constructor call
  56.             setMetafacadeContext (context);
  57.         }
  58.     }

  59.     /**
  60.      * @return boolean true always
  61.      * @see EntityQueryOperation
  62.      */
  63.     public boolean isEntityQueryOperationMetaType()
  64.     {
  65.         return true;
  66.     }

  67.     // ---------------- business methods ----------------------

  68.     /**
  69.      * Method to be implemented in descendants
  70.      * The query string for this EntityFinderMethod.  The query returned is based on the
  71.      * 'translation' passed in.  The translation must be one available to AndroMDA found with a
  72.      * translation-library.
  73.      * @param translation
  74.      * @return String
  75.      */
  76.     protected abstract String handleGetQuery(String translation);

  77.     /**
  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 String
  82.      * TODO: Model Documentation for
  83.      * EntityQueryOperation.getQuery(translation)
  84.      * @return handleGetQuery(translation)
  85.      */
  86.     public String getQuery(String translation)
  87.     {
  88.         // getQuery has no pre constraints
  89.         String returnValue = handleGetQuery(translation);
  90.         // getQuery has no post constraints
  91.         return returnValue;
  92.     }

  93.     // ------------- associations ------------------

  94.     /**
  95.      * @param validationMessages Collection<ModelValidationMessage>
  96.      * @see OperationFacadeLogicImpl#validateInvariants(Collection validationMessages)
  97.      */
  98.     @Override
  99.     public void validateInvariants(Collection<ModelValidationMessage> validationMessages)
  100.     {
  101.         super.validateInvariants(validationMessages);
  102.     }
  103. }