title: Hybris: How to get the name of an enum from context?
body: <p>this is my code:</p>
  
  <pre><code>public void onValidate(final Object o, final InterceptorContext ctx) throws InterceptorException
  {
      if (o instanceof ProductModel)
      {
          final ProductModel product = (ProductModel) o;
          if (!ctx.isNew(product))
          {
  
              if (StringUtils.isEmpty(product.getCode()))
              {
                  throw new InterceptorException("The Code must not be empty!");
              }
              if (StringUtils.isEmpty(product.getManufacturerName().toString()))
              {
                  throw new InterceptorException("The ManufacturerName must not be empty!");
              }               
              if (ctx.isModified(product, ProductModel.MANUFACTURERPRODUCTID)
                      || ctx.isModified(product, ProductModel.MANUFACTURERNAME))
              {
  
                  final boolean b = ProductLookupService.getProductforManufacturerName(product.getManufacturerName().toString());
  ...    
     }
  </code></pre>
  
  <p>I need the name of  enum ManufacturerName to compare it with another String, but my genereted getManufacturerName returns me just the code.What are my options? Here are the -item.xml and my generated get method:</p>
  
  <pre><code>&lt;enumtype code="ManufacturerName" generate="true" autocreate="true" dynamic="true"/&gt;
  &lt;itemtype code="Product" generate="false" autocreate="false"&gt;
      &lt;attributes&gt;
         &lt;attribute type="ManufacturerName" qualifier="manufacturerName" generate="true"&gt;
                      &lt;description&gt; &lt;/description&gt;
                      &lt;persistence type="property" /&gt;
                  &lt;/attribute&gt;
  ...
  &lt;/attributes&gt;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>/**
   * &lt;i&gt;Generated method&lt;/i&gt; - Getter of the &lt;code&gt;Product.ManufacturerName&lt;/code&gt; attribute defined at extension &lt;code&gt;myextension&lt;/code&gt;. 
   * @return the manufacturerName
   */
  @Accessor(qualifier = "manufacturerName", type = Accessor.Type.GETTER)
  public ManufacturerName getManufacturerName()
  {
      return getPersistenceContext().getPropertyValue(MANUFACTURERNAME);
  }
  </code></pre>
  
  <p>Thanks again!</p>