0

I have object

...
@CreatedDate
@Column(name = "created_date", nullable = false)
@JsonIgnore
private ZonedDateTime createdDate = ZonedDateTime.now();
...

table - postgeSQL

 create table inventory_request
 (...
   created_date timestamp,
   .....
 );

I need to select objects with databases between dates ZonedDateTime.now() and last year - ZonedDateTime.now().minusMonths(12)

my JPA repository

List<Inventory> findByCreatedDateBetween(ZonedDateTime now, ZonedDateTime end);

after execute i have only empty array, but values is present in database

I try use TimeStamp - 'java.lang.IllegalArgumentException: Parameter value [2018-11-20 14:44:23.528] did not match expected type [java.time.ZonedDateTime (n/a)]'

How is fix it? How to get the necessary data please help? Thanks!

GoodWin
  • 150
  • 10
  • Have you accidentally reversed the two arguments? I believe they should be in the order `(oneYearAgo, now)`. Depending on what your method expects, of course. – Ole V.V. Nov 20 '18 at 13:10
  • I'm an stupid!! ))) Thanks!!!! Very thanks! – GoodWin Nov 20 '18 at 13:25

0 Answers0