-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Labels
status: waiting-for-triageAn issue we've not yet triagedAn issue we've not yet triaged
Description
After upgrading to the current SNAPSHOT SpringBoot4 version, we get an InvalidDataAccessApiUsageException when calling an IgnoreCase method in CrudRepository if it is a property of an @Embedded object:
InvalidDataAccessApiUsageException: Unable to ignore case of com.example.demo.car.CarDetails types, the property “details” must reference a String
The error only occurs with SpringBoot4. Given is a Car class with a Details embeddable:
@Entity
public class Car {
....
@Embedded
private CarDetails details;
....
}
@Embeddable
public class CarDetails {
private String notice;
.....
}
The repository for this:
@Repository
public interface CarRepository extends CrudRepository<Car, String> {
public Optional<Car> findByDetailsNoticeIgnoreCase(String notice);
public Optional<Car> findByDetailsNotice(String notice);
}
The corresponding test only fails for IgnoreCase. With findByDetailsNotice, the property can be resolved correctly:
@Test
public void findByNotice() {
carRepository.findByDetailsNotice("test");
}
@Test
public void findByNoticeIgnoreCase() {
carRepository.findByDetailsNoticeIgnoreCase("test");
}
}
A simple test project can be found here: https://github.com/K-e-l-v-i-n-12/spring-data-jpa-issue
Metadata
Metadata
Assignees
Labels
status: waiting-for-triageAn issue we've not yet triagedAn issue we've not yet triaged