I want to have a spring data repository interface that takes two parameters. Is there a way to make it have the following behaviour?
MyObject findByParameter
I am new in Spring/JPA space,
use 'Query By Example'
i am using (in seviceImp) , all below arguments are optional/ depends on user choice
`
.
if (!firstName.isEmpty() ) {
staff.setFirstName(firstName);
}
if (!lastName.isEmpty() ) {
staff.setLastName(lastName);
}
if (!ptAadhar.isEmpty() ) {
patient.setPtAadhar(ptAadhar);
}
if (!Cell.isEmpty() ) {
staff.setCell(Cell);
}
Example example = Example.of(staff);
List staffList =staffRepository.findAll(example);
.