• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JPA and "persistence Provider"

 
Prannav Santhosh
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am new to this EJB world and could some explain me whats the difference between the JPA and "presistence Provider".? Also in the EJB 3 action book they had mentioned that "JPA standardizes ORM framework for java platform, you can plugin any ORM products". What does this mean?

Cheers,
Prannav.
 
Meherdad Bomanbehram
Ranch Hand
Posts: 142
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Prannav,
I am sure you have read what the book states and will not repeat that . I will try to answer in very simple terms as I understand this .
JPA is a query language and ORM definition . It allows you to write simple ands complex queries using Java obects (entities) .You may also write TSQL select (native) queries .
JPA is also a ORM in which you can design your design the model (M from MVC) . it basically maps tables to entities and manages their interactions with each other.
Its more usefull as the queries return business objects not rows and columns like in SQL .
persistence Provider is like a driver (ole native / JDBC /ODBC ) . It is basically used to connect to the database . There are quite a few providers examples are oracle/toplink or hibernate .

Hibernate is another ORM that you can use .




 
Hong Anderson
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Meherdad Bomanbehram wrote:Hi Prannav,
JPA is a query language and ORM definition . It allows you to write simple ands complex queries using Java obects (entities) .You may also write TSQL select (native) queries .
JPA is also a ORM in which you can design your design the model (M from MVC) . it basically maps tables to entities and manages their interactions with each other.

Actually, JPA is an API and a specification, it's not a query language but its specification includes JPQL.
In essence JPA is not an ORM tool, it's just an API/specification which ORM tools can implement.

Using JPA, you can change persistence provider without impact source codes, you can change persistence provider from Toplink to Hibernate by just changing configuration.
 
Prannav Santhosh
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you
 
Prannav Santhosh
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the clarification.
 
Duran Harris
Ranch Hand
Posts: 608
Eclipse IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could someone explain to me what changes are necessary for me to use entities?The book mentioned something about an SPI for for some javax.persistence class but I didn't fully understand.I have installed glassfish....will glassfish automatically use JavaDB as the database layer?(ie. I don't need to make extra configurations somewhere??)
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic