I have a separate jar file that contains entity mapping and hibernation directly. My Hibernate confg (cgf.xml) is placed in another jar file. And as a result, I will catch the exception "resource: com / iceleads / data / Test.hbm.xml not found".
Example:
entities.jar com.package.entity.TestEntity.java com.package.entity.TestEnity.hbm.xml mainUsage.jar com.package.main.MainClass.java - there are I get session factory SessionFactory factory = HibernateUtil.getSessionFactory(); com.package.main.hibernate.cfg.xml in HibernateUtil sessionFactory = new Configuration().configure("hibernate.cfg.xml").buildSessionFactory(); in hibernate.cfg.xml <mapping resource="com/package/entity/TestEntity/Test.hbm.xml"/>
entity.jar in class path mainUsage.jar
Please suggest me how can I customize hibernate.cfg.xml to use a separate entity jar.
Thanks a lot!
Artyom
Tioma source share