• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

where is net.sf.hibernate.Session?

 
Mike London
Ranch Hand
Posts: 1227
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to use the "find" method of the Session class in the library: net.sf.hibernate.Session, but I can't find this library.

Where is this jar file?

Thanks in advance.

Mike
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its part of the older version (2.x) of Hibernate. You can download the 2.x versions from here
 
Mike London
Ranch Hand
Posts: 1227
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jaikiran,

Thanks....but now you have me wondering if there is there a "better" way to do a "find" using Hibernate 3.

I think you mentioned using get in an earlier posting, but most of my books, which using HQL are still using find.

What would you recommend?

Look forward to your follow-up comments.

Thanks!!!

Mike
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It all depends on the version of Hibernate that you are using. The latest versions of Hibernate (3.x) no longer provide this find method. It has been deprecated. The Hibernate 3 migration guide mentions this:

Certain redundant methods were deprecated and removed from the org.hibernate.Session interface. However, to make migration easier, these methods are still available, via the org.hibernate.classic.Session subinterface. These deprecated methods are:

- query execution methods: find(), iterate(), filter(), delete()
- saveOrUpdateCopy()

Hibernate3 applications should use createQuery() for all query execution, DELETE queries for bulk delete and merge() instead of saveOrUpdateCopy(). Existing applications may continue to use the deprecated methods.
 
Mike London
Ranch Hand
Posts: 1227
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic