Hibernate 5 and entity mapping error
It could happen when you use Hibernate 5, that you will get entity not found error.
The problem can be fixed by creating session factory in other way:
Exception in thread "main" org.hibernate.MappingException: Unknown entity: com...Surprise, cause mapping is declared in hibernate.cfg.xml.
The problem can be fixed by creating session factory in other way:
SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory();
Comments
Post a Comment