Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • What makes you think you need a plain SessionFactory to be able to use hbm.xml files? Those work perfectly fine with an entity manager (and generally are picked up as well). So instead of complicating things just use JPA. I find it strange that you don't get an error with bootRun (although I think I know why, as that properly configures a JPA entity manager and your packaged jar fails due to not being able to read your hbm files). Commented May 29, 2016 at 18:18
  • i have many hbm that can not migrate to jpa.why HibernateJpaAutoConfiguration exclude not work ? Commented May 29, 2016 at 18:24
  • Please read. The fact that you have a HBM file doesn't mean you cannot use JPA. Either annotations or xml there has to be a mapping for your entity, for a Hibernate based JPA provider it can use both. So just use JPA so just use the entity manager and it will work with a HBM file. Commented May 30, 2016 at 5:41
  • yes i think know what you say .i want to use SessionFactory and ignore HibernateJpaAutoConfiguration? how can i do it? . and dont know why in " "java - jar " application dont sens hbm in jar dependency ?? but when copy hbm in project a application start ok ???? Commented May 31, 2016 at 19:17
  • Then exclude the auto config. But why do you want to use a session factory? What does it give you over an EntityManager? Commented Jun 1, 2016 at 5:31