找不到能够从 [java.math.BigInteger] 类型转换为 [org.club.entities.Depense] 类型的转换器

发布时间:2021-03-08 13:20

我得到以下堆栈跟踪:

org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting 
 from type [java.math.BigInteger] to type [org.club.entities.Depense]

我的课程如下

依赖实体

public class Depense {

@Id @GeneratedValue
//
@Temporal(TemporalType.DATE)
private Date datePay;

 @ManyToOne
 @JoinColumn(name = "idCategorie")
 private Categories categoriesD;

CategoreisRepository

public interface CategoriesRepository extends JpaRepository<Categories, Long>{

@Query(nativeQuery = true, value="select * from depense p inner JOIN categories pe on p.id_categorie = pe.id_cat ") 
public List<Depense> AfficheDepenseByCategories();

类别控制器

public class CategoriesController {

@Autowired
private IcategoriesService catserv;

@GetMapping("/AfficheCat")
public List<Depense> findAllC(){ return catserv.AffCateg();}
回答1