> Im learning Hibernate and have a very simple question. what's the relationship between Hibernate and JPA?
Hibernate could be used as JPA implementation. JPA itself is just a specification (bundle of interfaces mostly) that does not work without an implementation.
> "pure" hibernate use XML metadata and hibernate native API, they are strong but not obey EJB3 specification.
That is not technically correct. You can use JPA annotations with pure Hibernate too.
> "pure" EJB3 use JPA Annotation (or JPA XML metadata), and JPA API, but they can only be used in an EJB3 Application Server like JBoss, but not like Tomcat.
That is not correct either. JBoss is EJB3 implementation in a similar way as Hibernate is JPA implementation.
> I found a project which base on Spring Framework and Tomcat, in my opinion Spring Framework is an alternative to EJB3, so they use certainly Hibernate API but why use they JPA Annotation too?
That is correct. Spring is an alternative to EJB3. They, however, try to get as many users as possible, so they try to provide kind of "integration" wrappers to every framework in the world. If you have a choice I would suggest to stay away from this messy non-standard nightmare what Spring Framework became.
> Is the JPA Annotation not a part of EJB3?
JPA annotations are part of EJB3 as these are replacement of EJB2 entity beans.
> Can I just use it outside the EJB3 AppServer?
Yes, you can. Check out Hibernate JPA annotations.
> How do you work with Hibernation in your projects?
It is Hibernate, not HibernatION. In one of my latest projects I use standalone Hibernate with annotation. It is extremely nice to use. Try it our yourself.
|