package ee.bcs.andmed.jaagup; import org.hibernate.*; import org.hibernate.cfg.AnnotationConfiguration; public class AndmeProov3 { public static void main(String[] args) { SessionFactory sf=new AnnotationConfiguration().configure().buildSessionFactory(); Session s=sf.openSession(); Criteria cr=s.createCriteria(Telefoninumber.class); java.util.List telefoninumbrid=cr.list(); for(Object obj: telefoninumbrid){ Telefoninumber t=(Telefoninumber)obj; System.out.println(t.telnr); } s.close(); } }