title: JAVA JPA Containing Hibernate long search is not working
body: <p>Hi I am trying to do a search based on name mobile number and id
  Here : id is in string
  name is in string</p>
  <p>if queried with both works fine but for the same when i search with mobile number(Long) throws an error</p>
  <p><code>&quot;org.springframework.dao.InvalidDataAccessApiUsageException: Parameter value [%9%] did not match expected type [java.lang.Long (n/a)];</code></p>
  <p>my code as follows</p>
  <p>controller</p>
  <pre><code>@GetMapping(&quot;searching&quot;)
      public ResponseEntity&lt;Response&gt; searching(@RequestParam(&quot;Id&quot;) final String Id,
               @RequestParam(&quot;name&quot;) final String name,
              
              @RequestParam(&quot;phoneNumber&quot;) final Long phoneNumber,
               HttpSession session) {
          response = new Response();
          try {
  
              List&lt;UserDTO&gt; data = userService.searching(Id,  name,  phoneNumber );
              if (!data.isEmpty()) {
                  response.setMessage(StringConstance.SUCCESSFUL);
                  response.setData(data);
              } else {
                  return ResponseEntity.status(HttpStatus.NO_CONTENT).body(response);
              }
          } catch (Exception e) {
              e.printStackTrace();
              throw e;
          }
          return ResponseEntity.status(HttpStatus.OK).body(response);
      }
  </code></pre>
  <p>Service</p>
  <pre><code>public List&lt;UserDTO&gt; searching(String Id, String name,
              Long phoneNumber) {
       
          List&lt;UserDTO&gt; userDto = userRepository
                  .findByIdAndNameContainingIgnoreCaseAndPhoneNumberContaining(
                          Id,  name,   phoneNumber)
                  .stream().map(user -&gt; mapToDTO(user, new UserDTO())).collect(Collectors.toList());
          return userDto;
      }
  </code></pre>
  <p>Repository</p>
  <pre><code>List&lt;User&gt; findByIdAndNameContainingIgnoreCaseAndPhoneNumberContaining(
                          Id,  name,   phoneNumber)
  </code></pre>