• Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB3 and JPA

 
Cloey Tan
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can we use EJB3 but not together with the JPA, but something else? What else can be replacing JPA when it comes to EJB? And besides, what are the databases that can implement the EJB3 JPA specifications? IS there any downside of using JPA annotation instead of xml deployment descriptor?
 
Devaka Cooray
Marshal
Posts: 5178
496
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can user Hibernate as a persistence provider instead of JPA. But personally I like to use JPA when it is available. Even in Hibernate, there is a Hibernate EntityManager api which allow you to use JPA on both Java SE and EE platforms.
 
Aurelian Tutuianu
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JPA is a standard and is a part of EJB3 specification. Hibernate is a persistence framework which implements JPA standard.

Is possible to have EJB3 components and not use JPA, but that means you will not use Entity Beans (which is in fact JPA).
So, either you use Entity Beans (JPA) and Hibernate configured as the JPA implementation (JPA annotations and Hibernate Entity Manager), either you don't use JPA at all (no Entity Beans, only simple POJOs), but use Hibernate programmatic to persist POJOs using Hibernate API.

Standard way is to use Hibernate as a JPA implementation.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!