4

I mostly use Hibernate criteria API in my previous project. I found Hibernate criteria Expression is already deprecated!

Is Hibernate Criteria API stable for future usage?

http://docs.jboss.org/hibernate/core/3.3/api/org/hibernate/criterion/Expression.html

THIHA SOE
  • 165
  • 4
  • 9
  • I don't think they will remove it, but I would bet that there won't be manu evolutions and enhancements, because JPA2 now has its own criteria API. So I think all the efforts will go into this API rather than the Hibernate proprietary criteria API. – JB Nizet Oct 22 '11 at 16:57
  • Thank for your valuable answer! – THIHA SOE Oct 22 '11 at 17:23

2 Answers2

2

Its deprecated but they have provided Restrictions instead. But make sure you make the proper choice between HQL and criteria when fetching data in hibernate. I like HQL because its simple, flexible and powerful. Read more about hql here.

ManuPK
  • 11,623
  • 10
  • 57
  • 76
0

Well, things do get deprecated. If it's marked as such then don't use it. But if there is no note about deprecation - it's not deprecated. Only fortune teller can tell what happens in future. You can try to read forums and see if there is any discussion but I don't think criteria api is going away or undergo signifficant change.

Alex Gitelman
  • 24,429
  • 7
  • 52
  • 49