服务类:这里我对这个类做了注解,@componentscan注解中也提到了这个包@Servicepublic class EHSCheckedVehiclesGetter implements Callable<List<VehicleEHSDTO>> { private VehicleEHSRepository vrepo; private String buid; public EHSCheckedVehiclesGetter() { } public EHSCheckedVehiclesGetter(VehicleEHSRepository vrepo, String buid) { Assert.notNull(vrepo, "VehicleEHSInfoRepository cannot be null"); Assert.notNull(buid, "Business Unit Id cannot be null"); this.vrepo = vrepo; this.buid = buid; } @Override public List<VehicleEHSDTO> call() throws Exception { List<PVehicleEHSChecklistStatus> pVehicleEHSInfos = vrepo.findByBuid(buid); List<VehicleEHSDTO> vehicleEHSInfoDTOs = VehicleUtils.convert(pVehicleEHSInfos); return vehicleEHSInfoDTOs; }Repository 类:这是存储库的接口,我在 @EnableJpaRepositories 注释中将此包作为基本包public interface VehicleEHSRepository extends JpaRepository<PVehicleEHSChecklistStatus, PVehicleEHSChecklistStatusId>, MISRevisionRepository<PVehicleEHSChecklistStatus, PVehicleEHSChecklistStatusId, Integer> { @Query("from PVehicleEHSChecklistStatus where id.businessUnitId = ?1") List<PVehicleEHSChecklistStatus> findByBuid(String buid); @Query("from PVehicleEHSChecklistStatus where id.vehicleId = ?1") List<PVehicleEHSChecklistStatus> findByVehicleId(String vehicleId);这是否与除此之外的其他内容有关,因为我正在尝试更新项目中的技术堆栈。
1 回答
函数式编程
TA贡献1807条经验 获得超9个赞
您正在构造函数中注入一个字符串:public EHSCheckedVehiclesGetter(VehicleEHSRepository vrepo, String buid){ this.buid = buid }
错误是在初始化 EHSCheckedVehiclesGetter 时注入这个字符串
添加回答
举报
0/150
提交
取消