Calendar cal = Calendar.getInstance();
int year = cal.get(Calendar.YEAR);
int month = cal.get(Calendar.MONTH);
int date = cal.get(Calendar.DATE);
DateTestEntity o1 = context.newObject(DateTestEntity.class);
cal.set(year, month, date, 0, 0, 0);
o1.setTimestampColumn(cal.getTime());
DateTestEntity o2 = context.newObject(DateTestEntity.class);
cal.set(year, month, date, 23, 59, 59);
o2.setTimestampColumn(cal.getTime());
context.commitChanges();
EJBQLQuery query = new EJBQLQuery(
"SELECT d FROM DateTestEntity d WHERE d.timestampColumn < CURRENT_TIMESTAMP");