I have a ejb3 entity bean with the following property with an oracle database
Code:
@Column(name = "UPDTIME")
@Temporal(TemporalType.TIMESTAMP)
private Date updtime;
The actual database column is a DATE field.
I am trying to find the sum all entities that occurred today with the following HQL
Code:
Query query = entityManager.createQuery("select sum(u.topupAmt) from TransactionTable u where u.updtime=?");
query.setParameter(1, new Date(Utilities.currentTime()));
but it keeps returning multiple records. My assumption is that it is finding many timestamps instead of one date.
How can this be solved?