Issue
I'm having a hard time thinking how to provide a reproducible example, because there are a lot of moving parts. The basics are, I have a Spring Boot application using a JpaRepository, and I'm trying to search for a record with the string A40-CN0249RN2A
in one column, and am not able to get search results. Here are some data points I'll throw out to show where I've been:
- Using SpringBoot 2
- Using JpaRepository
- Using Hibernate
- Using Postgres
- I've confirmed the column has the data
- I've confirmed in a findAll() search that the data appears in a result entity
- I've logged the query and the bind variables and confirmed that the sql gets results in a sql client
- One SO article told me the dash was suspect. Regarding the dash:
- I'm able to search results on a different column with a dash
- I've confirmed that the dash I can search and the one I can't are the same ascii value
- I've replaced the dash with an _ wildcard and still cannot get results
- I cannot get results with
A40-CN0249RN2A
, but I can get results on the column withA40-
and with-CN0249RN2A
and with-
So lost and out of ideas. Thanks in advance for any help you can give me.
Solution
Embarrassing 2 days spent on this, and impossible to find from my description:
Spring Data paging starts with page 0, not page 1. You can get a lot of very diverse difficult-to-track-down errors with just this!
Answered By - orbfish
Answer Checked By - David Marino (JavaFixing Volunteer)