• Post Reply Bookmark Topic Watch Topic
  • New Topic

Comapring dates in hibernate

 
Shivali Sethi
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to compare dates in hibernate criteria API. In case If I have same StartDate and EndDate, how can i compare dates using "between" keyword. can i use trunc keyword in hibernate?
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I want to compare dates in hibernate criteria API. In case If I have same StartDate and EndDate, how can i compare dates using "between" keyword

You can do this using the between Criterion. Read the JavaDocs for the Restrictions class.


can i use trunc keyword in hibernate?

Yes.
 
Think of how stupid the average person is. And how half of them are stupider than that. But who reads this tiny ad?
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!