As I have read in the documentation, Spring Data JDBC supports query creation like Spring Data JPA
For Example:
findByProperty(Property property)
My question :
Does Spring Data JDBC support situation where we create a query and join two (or more) entities using their properties to find the result like in Spring Data JPA?
Example:
@Entity
class Person {
private final @Id Long id;
private final Car car;
}
@Entity
class Car {
private final @Id Long id;
private String color;
}
interface PersonRepository extends CrudRepository<Person, Long> {
List<Person> findByCarColor(Color red);
}
interface CarRepository extends CrudRepository<Car, Long> {
}
I want to find all persons who have at least one red car. Will that method gives proper output?