Thats mean I do not need full fledge container. What I need is JPA binaries(jar instead of hibernate.jar(s)). So, I can write the persistent layer using JPA and can persist from java main().
Client with java main() -> persistence layer(JPA) -> DB Layer. (No container)
But, I could not understand why we need JPA implementation. Is it not part of the JPA library. Why we should rely on hibernate/iBatis etc?
But, I could not understand why we need JPA implementation
JPA is only a set of interfaces with one utility class to get an entity manager factory (javax.persistence.Persistence). EntityManagerFactory and other interfaces are implemented by a provider, so without it you're not going to do anything. [ April 26, 2007: Message edited by: Satou kurinosuke ]
Xavier George
Ranch Hand
Joined: Jul 29, 2005
Posts: 39
posted
0
Ok, that means you are saying provider for JPA could be Hibernate. So what I understood is - Hibernate could be JPA provider because Hibernate config file i.e. hibernate.cfg.xml encapsulate database related information which is responsible for managing DB connection pooling etc. which JPA could not provide. Correct me if I am wrong.
Erik Bengtson
Ranch Hand
Joined: Dec 06, 2003
Posts: 90
posted
0
In JPA you can either use annotations or orm.xml metadata file to define database related information.
Another JPA implementation to try is JPOX. The implementation that I'm developing
Originally posted by Xavier George: Ok, that means you are saying provider for JPA could be Hibernate. So what I understood is - Hibernate could be JPA provider because Hibernate config file i.e. hibernate.cfg.xml encapsulate database related information which is responsible for managing DB connection pooling etc. which JPA could not provide. Correct me if I am wrong.
Yes, Hibernate implements the JPA specification. You need to have some products implementation for it to run.
Yes, Hibernate implements the JPA specification. You need to have some products implementation for it to run.
Mark
Can. Have. I worked with the OpenJPA folks over on the Apache site and did just fine. Found a few bugs for them, even!
One of the most odious afflictions that Business has inflicted on the modern English language is "pro-active". Most of the time it's simply redundantly used in place of the simple old word "active". And a good deal of the rest of the time it means "You're not overworked enough yet, so go out and find more!"