How to use to_char function in JPA to get records from a timestamp
I am try to query from and database using eclipse link using entities. when I use normal query records are returned from current date by when I use JPA zero records are returned. Where could I be doing wrong, Or how can I use to_char function in JPA my database is postgresql. normal sql query that returns records select * from mytable where to_char(transaction_date, 'YYYY-MM-DD') = '2016-01-19'; MyEntity @Temporal(javax.persistence.TemporalType.DATE) private Date transaction_date; EntityManager e = EntityMgr.MyFact().createEntityManager(); e.getTransaction().begin(); Query qry = e.createQuery(
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.