package ee.bcs.andmed.jaagup; import org.hibernate.*; import org.hibernate.cfg.AnnotationConfiguration; public class AndmeProov1 { public static void main(String[] args) throws Exception{ SessionFactory sf=new AnnotationConfiguration().configure().buildSessionFactory(); Session s=sf.openSession(); Transaction tx=s.beginTransaction(); Koer k=new Koer(); k.setKoeranimi("Palli"); k.setSynniaasta(2012); s.save(k); tx.commit(); s.close(); } }