• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Persistence provider

 
Prannav Santhosh
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) I have a question regarding the Persistence Provider. In the EJB 3 action book it has been mentioned that the In EJB 3 terms, a persistence provider is essentially an ORM framework. For example , let us consider JBoss Hibernate and Oracle TopLink. My question is how will my entity look different for these ORM frame work ?.

2) Also , in EJB 3 action it has been mentioned that the JPA defines a standard for
a)The creation of ORM configuration metadata for mapping entities to relational tables
b)The EntityManager API
c)The Java Persistence Query Language (JPQL)

Can some one explain me what does the above statement means?

Thanks for your help.


 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1)My question is how will my entity look different for these ORM framework ?.

I'm not sure to understand what you mean by "look different". Even though a persistence provider is essentially an ORM framework, a JPA compliant provider has to comply to some specific rules, defined by the JPA specification, so that your entity will behave the same way with provider A and provider B.

Can some one explain me what does the above statement means?

It means that a) b) and c) are defined by the JPA specification, which all JPA containers must comply to.
 
Deepika Joshi
Ranch Hand
Posts: 268
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how will my entity look different for these ORM frame work

Your Entity will look (talk) only to EM (EmtityManager) interface which is responsible for life cycle of an entity (in container or outside container (J2SE case)).

EM will communicate to persistence provider (binaries), which could be Toplink, Hibernate, anything else.

Every Application Server (continer) has default implementation (set of binaries). Like JBoss uses Hibernate & Oracle uses Toplink.

If you want to use JBoss with Toplink, you would need to update configuration file & provide the Toplink binaries.

EM will consider to use persistence provider implementation mentioned in your configuration file.

JPA defines a standard for
a)The creation of ORM configuration metadata for mapping entities to relational tables
b)The EntityManager API
c)The Java Persistence Query Language (JPQL)


a) mapping Entity (your class) with table (& columns)
b) responsible for maintainance of life cycle of entity (e.g. add, update, del, find - operations)
c) query language used to write Object-Relational queries, which gets converted to SQL while performing CRUD operation and return entity(ies) instead of a record(s)

Once you read ch 6,7,8,9 - all thing would be clear to you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic