title: Spring AOP : Around aspect not working
body: <p>I have one POJO class on which i have to hijack one of its method with my own logic.</p>
  
  <p>POJO : </p>
  
  <p>CustomerModel</p>
  
  <pre><code>package com.test.model;
  
  public class CustomerModel
  {
      public static final String EMAIL = "email";
      public static final String uid = "uid";
      public static final String DEFAULTB2BUNIT = "defaultB2BUnit";
  
      @Accessor(qualifier = "defaultB2BUnit", type = Accessor.Type.GETTER)
      public B2BUnitModel getDefaultB2BUnit()
      {
          return getPersistenceContext().getPropertyValue(DEFAULTB2BUNIT);
      }
  
      ...
  }
  </code></pre>
  
  <p>This POJO class is auto generated and i can't change it. I want to use spring AOP feature to hijack getDefaultB2BUnit() method so that i can execute my logic to send correct B2BUnit.</p>
  
  <p>So far i have done this ..</p>
  
  <p>Aspect -</p>
  
  <pre><code>@Aspect
  public class AccountSelectionAspect
  {
  
  @Resource
  private AccountSelectionService accountSelectionService;
  
  @Around("execution(* com.test.model.CustomerModel.getDefaultB2BUnit())")
  public Object decideAround(final ProceedingJoinPoint joinPoint) throws Throwable
  {
      final B2BUnitModel account = accountSelectionService.getSelectedAccount();
  
      if (account == null)
      {
          return joinPoint.proceed();
      }
  
      return account;
  }
  }
  </code></pre>
  
  <p>spring.xml -</p>
  
  <pre><code>&lt;aop:aspectj-autoproxy /&gt;
  &lt;bean class="com.test.core.account.aspect.AccountSelectionAspect"/&gt;
  </code></pre>
  
  <p>Now this aspect is not calling at all. Whenever there is a call made to fetch defaultB2BUnit, AOP is not hijacking the method.</p>
  
  <pre><code>final CustomerModel customer = currentUser;
  B2BUnitModel defaultB2BUnit = customer.getDefaultB2BUnit();
  </code></pre>
  
  <p>Kindly suggest.</p>
  
  <p><strong>Update -</strong></p>
  
  <p>Can I not be able to use AOP on POJO class? What is the alternative then ?</p>