天天看点

Spring Data JPA使用findTopOrderBy时踩的坑

Caused by: org.springframework.data.mapping.PropertyReferenceException: No property desc found for type Integer! Traversed path: Version.id.

想默认使用某个字段排序,不止要写OrderById,还要在这段之前加By,正确写法是 findTopByOrderById