Guest User

Untitled

a guest
Jan 17th, 2018
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. Exception in thread "main" org.hibernate.internal.util.config.ConfigurationException: Unable to perform unmarshalling at line number 0 and column 0 in RESOURCE hibernate.cfg.xml. Message: null
  2.  
  3. package hibernate1;
  4.  
  5. import org.hibernate.Session;
  6. import org.hibernate.SessionFactory;
  7. import org.hibernate.cfg.Configuration;
  8.  
  9. public class HibernateTest {
  10.  
  11. public static void main(String[] args) {
  12.  
  13. UserDetails user = new UserDetails();
  14. user.setUserId(1);
  15. user.setUserName("oguzhancevik");
  16.  
  17. SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory();
  18. Session session = sessionFactory.openSession();
  19. session.beginTransaction();
  20. session.save(user);
  21. session.getTransaction().commit();
  22.  
  23. }
  24.  
  25. }
Add Comment
Please, Sign In to add comment