but in hibernate 2 ,this command is not working to create a session,so how to create a session in hibernate 2?
Post subject:Posted: Jul 20, 2006 - 08:44 PM
Joined: Feb 03, 2006
Creating session is the same in hibernate 2 and hibernate 3. Hibernate 3 have added EntityManager, but it isn't part of hibernate (it is added product) and used for ejb3.
You have to use SessionFactory and MyEclipse can make SessionFactory utility class
You can see example making session factory when you add hibernate capabilities (or separate wizard in MyEclipse 5.0M2).
You can grab session with getCurrentSession method