package esimene; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.Transaction; import org.hibernate.cfg.Configuration; public class Test2 { public static void main(String[] kapsas) { Configuration c = new Configuration().configure(); SessionFactory sf = c.buildSessionFactory(); Session s = sf.openSession(); try { Isik isik = (Isik)s.get(Isik.class, 1); System.out.println(isik.getEesnimi()); } catch (Exception e) { System.out.println(e.getMessage().toString()); } s.close(); } }