天天看點

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