title: java inheritance of autowired properties
body: <p>I have two classes:</p>
  
  <pre><code>@Transactional
  public class A {
  
  @Autowired
  protected SessionFactory sessionFactory;
  
  //other methods
  }
  
  @Transactional
  public class B extends A {
  
      Session session = sessionFactory.getCurrentSession();
  
      //other methods
  }
  </code></pre>
  
  <p>Here I want to inherit property autowired into superior class, but I get NPE when try to use it in child class. Is it possible to inherit autowired properties using classic java inheritance?</p>
  
  <p><strong>EDIT</strong>: BUT if I delete it from property fields and put it directly into methods like <em>sessionFactory.getCurrentSession()</em> - it works!!!!</p>