Hello everyone, please tell me what can be connected with the following error
There was an unexpected error (type=Internal Server Error, status=500). could not prepare statement; SQL [select count(user0_.id) as col_0_0_ from users user0_ cross join user_roles roles1_ where user0_.id=roles1_.user_id and (upper(user0_.first_name) like ?) and (upper(user0_.first_name) like ?) and (upper(user0_.last_name) like ?) and (upper(user0_.email) like ?) and user0_.enabled=1 and .=?]; nested exception is org.hibernate.exception.SQLGrammarException: could not prepare statement
Occurs when calling this method.
public Page<UserListingDTO> getAllUsersForListing(Pageable pageable, UserCriteria userCriteria) { PageRequest pageRequest = new PageRequest(pageable.getPageNumber(), pageable.getPageSize()); Page<User> userList; if (userCriteria == null) { userList = userRepository.findAll(pageRequest); } else { SpecificationBuilder<User> builder = buildUserSpecification(userCriteria); userList = userRepository.findAll(builder.buildSpecification(), pageRequest); } Page<UserListingDTO> userPage = userList.map(this::convertToListingDTO); return userPage; }
and more specifically in this line
userList = userRepository.findAll(builder.buildSpecification(), pageRequest);
and .=?
- Akina