I just upgraded my project to spring5 which is causing the below error for the code which was working fine with earlier spring version.
The problem is JPA should map aNumber to ANumber but its not doing so its taking ANumber as ANumber rather than aNumber which is causing this issue.
I see one thread for spring team but cannot see the resolution here: https://github.com/spring-projects/spring-data-jpa/issues/1247
I tried to search everywhere but didn't find anything useful.
Domain Class:
@Data
@Entity
public class Statistics {
@Id
private Long id;
private String aNumber;
private Integer dispositionCode;
@CreatedDate
private OffsetDateTime created;
}
the method in Repository interface:
Optional<Statistics> findFirstByIdAndANumberAndDispositionCodeInOrderByCreatedDesc(Long id, String aNumber, Integer... dispositionCode);
Note: i know id can return unique result just to make exact example I made that change.