public class TenderAdminService extends BaseService<Tender> { private LoanAdminService loanAdminService = LoanAdminService.me; private void searchLoanIdList(){ //这个地方loanAdminService是null loanIdList = loanAdminService.searchLoanIdList(loanCondition); } } public class LoanAdminService extends BaseService<Loan> { private TenderAdminService tenderAdminService = TenderAdminService.me; }
代码大致如此。
注释的地方,为啥会出现为null呢?
普通代码,发现互相依赖没问题。
感觉是JFinal 或者 Model 的问题。
2个Service都继承了BaseService。
public abstract class BaseService<T extends Model<T>>
项目:JFinal