title: Why is @Repository annotation being proxied , but not @Component
body: <p>I am trying to understand which types of beans in Spring are being proxied, so far i understood its the <code>@Aspect</code> , <code>@Transactional</code> annotated classes. So I played a bit on my PC, and noted that if I annotate a class with <code>@Component</code>, it's not getting proxied when Autowired, but if I just change the annotation to <code>@Repository</code>, it is proxied by CGLIB. As far as i understand, <code>@Repository</code> is just an alias of <code>@Component</code>, why is it getting proxied and the other one not ?</p>
  <p>Here are the example very simple classes</p>
  <pre><code>import org.springframework.stereotype.Component;
  import org.springframework.stereotype.Repository;
  
  @Repository
  public class JustForTest {
  
      private final String hello = &quot;&quot;;
  
      public String getHello() {
          return hello;
      }   
  } 
  </code></pre>
  <p>and</p>
  <pre><code>import org.springframework.stereotype.Component;
  import org.springframework.stereotype.Repository;
  
  @Component
  public class JustForTest {
  
      
      private final String hello = &quot;&quot;;
  
      public String getHello() {
          return hello;
      }
  }
  </code></pre>