DEV Community

sureshhunagund
sureshhunagund

Posted on

JPA to implement epoc

Need help to implement
below part of sql in where clause using JPA CriteriaBuilder in java

abs(extract(epoch from shift_start_date - shift_end_date)/3600) < 8

here is the full sql
SELECT *
FROM tbl_schedule
where start_date >= '2022-01-10'
and end_date <= '2022-01-16'
and labour_id in ('123123')
and abs(extract(epoch from start_date - end_date)/3600) < 8
and location = '01201'

Top comments (0)