Your requirement: the difference between the two set dates must be at least four minutes. According to JPA 1.0 specification, a comparison expression between dates should follow this pattern
datetime_expression compare_operator datetime_expression
compare_operator =, > , > =, <, < =, < > . ,
Timestamp dateA ...
Timestamp dateB ...
Timestamp difference = new Timestamp(Math.abs(dateA.getTime() - dateB.getTime()));
Timestamp, 4
Timestamp fourMinutes = new Timestamp(0, 0, 0, 0, 4, 0, 0);
where :difference >= :fourMinutes