seniors, use SpringJPA for the first time. Now the entity class has a field that looks like this:
private String movie_id;
and I want to sort through this field. After inheriting PagingAndSortingRepository, the code is:
Sort sort = new Sort(Sort.Direction.DESC,"movie_id");
Pageable pageable = PageRequest.of(0,PAGE_LIMIT,sort);
Page<MovieInfo> movieInfopage = movieInfoRepository.findAll(pageable);
but made a mistake:
org.springframework.data.mapping.PropertyReferenceException: No property movie found for type MovieInfo!
at org.springframework.data.mapping.PropertyPath.<init>(PropertyPath.java:92) ~[spring-data-commons-2.0.6.RELEASE.jar:2.0.6.RELEASE]
at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:356) ~[spring-data-commons-2.0.6.RELEASE.jar:2.0.6.RELEASE]
you can manually change movie_id to movieId.
that must be because the frame does not recognize the underscore.
what to do with the seniors! Can I not change the field name greatly?