• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HQL date without time

 
Gigi Kent
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys.

I have a small problem with hibernate.
I need to do a query and in my where clause I have a date, something like that:

The problem is that in my database <date_field> is a datetime, and I need to take all the records from today, so only date, without time.
I found that

is working, but this is Oracle; I need something hql, and generic.

Any ideas someone?

Thanks.
Corneliu.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you not use between and two dates?
 
Gigi Kent
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I could, but I would like to find something more elegant.
...if there is.
 
Alexander Curvers
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i need this too so im boosting the topic
 
Rahul Babbar
Ranch Hand
Posts: 210
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had a similar issue and it was resolved here
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic