-1

How do I configure hibernate?

If hibernate-entitymanager package is used for JPA then what good is of hibernate-jpa package. And I have seen that they use org.hibernate.ejb.HibernatePersistence class is used for JPA provider in persistence.xml which is in hibernate-entitymanager package.

In some cases, I have not seen the provider tag in persistence.xml. In this case which class is used?. Does Session class has EntityManager or implements it . And none of hibernate beans are specified in Spring-application context file directly. Instead spring.orm packages are used. So spring framework picks which class for JPA functionality.

org.springframework.orm.jpa.LocalEntityManagerFactoryBean picks which bean if provider tag is specified and if provider tag is not specified which bean is picked?

Anthon
  • 69,918
  • 32
  • 186
  • 246
harsha kumar Reddy
  • 1,251
  • 1
  • 20
  • 32
  • 4
    Picking which software to use is not on topic at programmers.stackexchange.com... – enderland Apr 20 '15 at 17:15
  • @AndritchiAlexei see above ^^^. Recommended reading: **[What goes on Programmers.SE? A guide for Stack Overflow](http://meta.programmers.stackexchange.com/q/7182/31260)** – gnat Apr 20 '15 at 18:15

2 Answers2

0

Hibernate JPA is a standard JPA implementation. See also these other questions about differences.

Session and EntityManager do approximately the same thing. EntityManager is the "new way."

I'm not clear on what your questions are about the persistence.xml file.

Community
  • 1
  • 1
Barett
  • 5,826
  • 6
  • 51
  • 55
  • Thanks for reply but my Question was in which package the jpa implementation actually is . Is it in hibernate entitymanager.jar or hibernate-jpa2.1.jar . – harsha kumar Reddy Apr 21 '15 at 03:19
0

Thanks for reply but my Question was in which package the jpa implementation actually is . Is it in hibernate entitymanager.jar or hibernate-jpa2.1.jar . I found this fallowing link to be of little use .https://docs.jboss.org/jbossas/docs/Server_Configuration_Guide/4/html/ch01s02s01.html

but in this case in persistence.xml file contains org.hibernate.ejb.HibernatePersistence as jpa provider but this class is in hibernate-entitymanager package . But they also told that hibernate-jpa-2.0-api.jar is the JAR containing the JPA 2.0 API, it provides all the interfaces and concrete classes that the specification defines as public API. Said otherwise, you can use this JAR to bootstrap any JPA provider implementation. in this fallowing link https://docs.jboss.org/hibernate/entitymanager/3.5/reference/en/html/configuration.html please could some one help me with this

harsha kumar Reddy
  • 1,251
  • 1
  • 20
  • 32