2

私は次のものを持っています:

public class ClaimFacadeImpl implements ClaimFacade {

    @Autowired
    private DebtRepository<Claim> debtRepository;

    @Autowired
    private DebtRepository<Fine> fineRepository;

    //other stuff

}

public interface DebtRepository <T extends Debt> {
   //nothing special
}

public class DebtRepositoryImpl <T extends Debt> implements DebtRepository <T> {
   //nothing special
}

そして2クラス。1 件の請求と 1 件の罰金の両方が債務を延長します。エラーが発生しますMore than one field with type interface domain.debt.DebtRepository

私は何をすべきか?

4

1 に答える 1

4

まだ行っていない場合は、Spring 4.0 にアップグレードします。

http://spring.io/blog/2013/12/03/spring-framework-4-0-and-java-genericsを参照してください。

于 2014-11-06T10:55:17.943 に答える