• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

where is net.sf.hibernate.Session?

 
Bartender
Posts: 1757
17
  • 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
 
Sheriff
Posts: 10445
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
Bartender
Posts: 1757
17
  • 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
Sheriff
Posts: 10445
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
Bartender
Posts: 1757
17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.
 
grapes are vegan food pellets. Eat this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic