title: Spring Data JPA Pagination (Pageable) with Dynamic Queries
body: <p>I have a simple query as follows "select * from USERS". I also use Pageable to enable pagination.</p>
  
  <p>This query may have optional predicates based on the given parameters being null or not.</p>
  
  <p>For example if "code" parameter is given and not null, then the query becomes
  "select * from USERS where code = :code";</p>
  
  <p>As far as I know I cannot implement this using @Query annotation. I can implement a custom repository and use EntityManager to create a dynamic query.
  However, I am not sure how I can integrate "Pageable" with that to get back paginated results.</p>
  
  <p>How can I achieve this? </p>