我的 jpa 存储库中有此查询
@Query("SELECT new mx.com.sk.AveragesPojo(AVG(a.initial), AVG(a.initialEFSL), AVG(a.finalEFSL), AVG(a.entitySettlement)) FROM AveragesModel AS a WHERE groupName = :groupName AND idRemote = :idRemote")
public AverajesPojo getLastSurveyAverages(@Param("groupName") String groupName, @Param("idRemote") Long idRemote);
}
在我的 pojo 构造函数中是:
public AverajesPojo(Float initial, Float initialEFSL, Float entitySettlement, Float finalEFSL) {
super();
this.initial = initial;
this.initialEFSL = initialEFSL;
this.entitySettlement = entitySettlement;
this.finalEFSL = finalEFSL;
}
但我有这个错误:
创建名为“averagesRepository”的 bean 时出错:调用 init 方法失败;嵌套异常是 java.lang.IllegalArgumentException:查询方法公共抽象 mx.com.sk.pojos.AverajesPojo mx.com.sk.admin.repositories.AveragesRepository.getLastSurveyAverages(java.lang.String,java.lang.长)!
我的错误是什么?
繁星coding
相关分类