I want to use "Like" like query but result should be scanned from starting e.g., "starts with"
List<Account> findByUserInfo_FirstNameRegexAndUserInfo_LastNameRegexAndEmails_EmailIDRegex(String firstName, String lastName, String emailID);
or
List<Account> findByUserInfo_FirstNameLikeAndUserInfo_LastNameLikeAndEmails_EmailIDLike(String firstName, String lastName, String emailID);
works great with API I made.
Here is my controller code using Spring,
@RequestMapping(value = baseUrl + "/search", method = RequestMethod.GET)
public List<Account> getSimilarAccountList(@RequestParam(value = "fullName", required = false) String fullName, @RequestParam(value = "emailID", required = false) String emailID, @RequestParam(value = "mobile", required = false) String mobileNumber) {
log.info("Request to fetch all the accounts recieved.");
return accountService.getSimilarAccountList(fullName, emailID, mobileNumber);
I am calling API through postman using,
http://localhost:9098/account/search?fullName=kk
giving me same result
"firstName": "akki"
but I want it to only works with http://localhost:9098/account/search?fullName=ak
I hope, I could make my question clearer.