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个班。一项索赔和一项罚款都延长了债务。我收到错误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 回答