Spring属性注入

//接口 IMtOpProvidePercentageManager
 public interface IMtOpProvidePercentageManager extends BaseManager {

 }  

//接口实现类 MtOpProvidePercentageManager
public class MtOpProvidePercentageManager extends
BaseSingleEntityManagerSupport<MtOpProvidePercentage> implements
IMtOpProvidePercentageManager {
}

public class MtOpProvidePercentChangeManager extends
BaseSingleEntityManagerSupport<MtOpProvidePercentChange> implements
IMtOpProvidePercentChangeManager {
IMtOpProvidePercentageManager mtOpProvidePercentManager=null;
public IMtOpProvidePercentageManager getMtOpProvidePercentManager() {
return mtOpProvidePercentManager;
}
public void setMtOpProvidePercentManager(
IMtOpProvidePercentageManager mtOpProvidePercentManager) {
this.mtOpProvidePercentManager = mtOpProvidePercentManager;
}
注入MtOpProvidePercentageManager类
<bean id="mtOpProvidePercentManager" parent="baseManager" scope="singleton"
class="com.jtv.mmis.module.mtopprovidepercentage.manager.MtOpProvidePercentageManager">
<description>供货比例</description>
</bean>
注入MtOpProvidePercentChangeManager类,并注入属性mtOpProvidePercentManager,引用MtOpProvidePercentageManager类的bean id
<bean id="mtOpProvidePercentChangeManager" parent="baseManager"
scope="request"
class="com.jtv.mmis.module.mtopproviderinfo.manager.MtOpProvidePercentChangeManager">
<description>供货比例-变动 manager</description>
<property name="mtOpProvidePercentManager" ref="mtOpProvidePercentManager" />
</bean>

你可能感兴趣的:(spring,bean,Class,interface)