Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PersonRepo.java
- @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)
- Iterable<Person> findPeopleWhoBoughtProductWithinPeriod(@Param("productId") int productId,
- @Param("from") String from,
- @Param("through") String through);
- GeneralService.java
- Iterable<Person> peopleInFeb = personRepo.findPeopleWhoBoughtProductWithinPeriod(2,
- "2019-02-01",
- "2019-02-28");
- Traceback
- Caused by: org.postgresql.util.PSQLException: ERROR: operator does not exist: timestamp without time zone >= character varying
- Hint: No operator matches the given name and argument types. You might need to add explicit type casts.
Advertisement
Add Comment
Please, Sign In to add comment