/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package esimene; import org.hibernate.Criteria; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.Transaction; import org.hibernate.cfg.Configuration; import org.hibernate.criterion.Restrictions; import java.util.List; /** * * @author Opetaja */ public class Test3 { public static void main(String[] arg){ Configuration c = new Configuration().configure(); SessionFactory sf = c.buildSessionFactory(); Session s = sf.openSession(); try { Criteria cr=s.createCriteria(Isik.class); List vastus=cr.list(); for(int i=0; i