I have an entity with two columns:
// time when the event happened (stored in UTC)
@Temporal(TemporalType.TIMESTAMP)
private Date eventTime;
// timezone offset in milliseconds
// so local millis are eventTime.getTime() + offset
@Basic
private int offset;
It appears that in JPQL queries I can't use something like WHERE eventTime + offset > :parameter
. But is it possible to work around by casting eventTime
to a long in some way? Of course, there is an option of using native queries...
EDIT: It isn't supported in the standard and isn't mentioned in OpenJPA documentation, so probably not possible at the moment.