Win a copy of Rust Web Development this week in the Other Languages forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Persistence provider

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.


 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 268
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic