Nonverbis

Untitled

Nov 23rd, 2020
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. PersonRepo.java
  2.  
  3. @Query(value="select person.id, person.email, person.first_name, person.last_name, person.phone from orders join customers on orders.customer_id = customers.id join person on person.id=customers.person_id join order_item on order_id = orders.id where created >= :from and created <= :through and order_item.product_id= :productId", nativeQuery = true)
  4. Iterable<Person> findPeopleWhoBoughtProductWithinPeriod(@Param("productId") int productId,
  5. @Param("from") String from,
  6. @Param("through") String through);
  7.  
  8.  
  9.  
  10. GeneralService.java
  11.  
  12. Iterable<Person> peopleInFeb = personRepo.findPeopleWhoBoughtProductWithinPeriod(2,
  13. "2019-02-01",
  14. "2019-02-28");
  15.  
  16.  
  17. Traceback
  18.  
  19. Caused by: org.postgresql.util.PSQLException: ERROR: operator does not exist: timestamp without time zone >= character varying
  20. Hint: No operator matches the given name and argument types. You might need to add explicit type casts.
  21.  
  22.  
Advertisement
Add Comment
Please, Sign In to add comment