Inject spring dependency in abstract super class

后端 未结 3 1714
忘了有多久
忘了有多久 2020-12-05 13:41

I have requirement to inject dependency in abstract superclass using spring framework.

class A extends AbstractClassB{ 
    private Xdao daox ;
    ...
    p         


        
3条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-05 14:19

    You can use the abstract flag of Spring to tell Spring that a class is abstract. Then all concrete implementations can simply mark this bean as their parent bean.

    
      
    
    
    
      
    
    

提交回复
热议问题