Reputation: 5165
I study hibernate, AFAIK you can use xml or annotation, I like annotation more so trying this method.
then code:
SessionFactory session = HibernateUtil.getSessionFactory();
CallInfo ci = new CallInfo(1234567); //POJO class
session.getCurrentSession().save(ci);
and hibernate still wants the xml, why?
Exception in thread "main" java.lang.ExceptionInInitializerError
at ru.asteros.sochi.feedback.util.HibernateUtil.<clinit>(HibernateUtil.java:28)
at ru.asteros.sochi.feedback.SochiFeedback.main(SochiFeedback.java:52)
Caused by: org.hibernate.MappingNotFoundException: resource: ru/asteros/sochi/feedback/CallInfo.hbm.xml not found
at org.hibernate.cfg.Configuration.addResource(Configuration.java:563)
Upvotes: 1
Views: 517
Reputation: 12054
probably CallInfo.hbm.xml
is referenced in hibernate.cfg.hbm
and its not in valid class path
Upvotes: 1