Is there a version like JPA 3?

AFAIK, the last and best thing I've used is JPA 2.0.

I was confused that GAE has a jar, somewhat called appengine-java-sdk-1.6.5 / lib / user / orm / geronimo-jpa_3.0_spec-1.1.1.jar. I got the impression that GAE always has latency when using compatibility with the latest, best bleeding protocols. It took them a while to adopt JPA 2.0.

What is this JPA 3.0 that does inside the GAE SDK libs? Is there a version like JPA 3.0? Does Google currently support us by introducing the new version protocol earlier than everyone else? Is there a JPA 3.0 specification or link where I could link?

I am not (currently) an EJB person (sorry ... decided to avoid EJB since I had bad experience with EJB 1.0 10 years ago).

  • Is EJB 3.0 synonymous with JPA 2.0,
  • or JPA 2.0 adopted as a subset of EJB 3.0
  • or JPA 3.0 = EJB 3.0?

WRT I asked this question: transition from Hibernate entitymanager 3.6.9 to 4.1.2 mysql connection failed , Is Hibernate entity-manager 4.x somehow connected with JPA 3.0, or at least with JPA version later 2.0 ? I experience significant differences between Hibernate entity-manager 3.x and 4.x (and have so far avoided 4.x deployments).

I understand that this question is quite confusing and maybe I should have asked each of the questions as an individual question, but I hope that someone can tie it all together in one thesis: ejb 3, JPA 2/3, geronimo, hibernate ent-mgr 3/4. Thanks.

+6
source share
3 answers

No, there is no such thing (in June 2012) like JPA3. There is JPA1, JPA2 and (when planning) JPA2.1. This geronimo-specs jar is actually for JPA1, but some very short-sighted people / group decided to call it that and now see the consequences of it.

As you say, GAE already supports JPA2 using v2.x of its JPA plugin, available from Maven repositories or here http://code.google.com/p/datanucleus-appengine/ and works with compatible jpa-api v2 jar (e.g. geronimo-jpa_2.0_spec).

+7
source

As others have said, JPA 2.0 is the current version (part of Java EE 6), and the next version will be JPA 2.1, which is currently in the specification ( JSR 338 ) and will be included in Java EE 7. There is currently no JPA 3, so the JAR is just badly named.

JPA 1.0 was introduced as part of Java EE 5, dividing part of the persistence into the EJB specification (therefore Java EE 5 introduced EJB 3.0 and JPA 1.0, not more than Entity Beans, yes!). Then Java EE 6 included EJB 3.1 and JPA 2.0.

Java EE 7 will include EJB 3.2 and JPA 2.1.

+7
source

I am talking about a fix here, as things could have changed since the last time I worked seriously with JPA. However, JPA 2, in my opinion, is the current specification. I doubt that the jar you specified is a JPA 2 specification. In 2011, Geronimo did not support JPA 2 out of the box at this point.

Regarding EJB and JPA:

  • Both EJB and JPA are based on POJO (plain old Java objects).
  • JPA classes are essentially data access layer technology used to interact with your data layer.
  • EJB is essentially used for the business layer. It will contain the business logic and organize the interaction between the various JPA classes. For example, in JPA you may have a customer class (which interacts with the customer table) and an order class (which interacts with the Orders table). In your EJB, you will use both of these classes to create a new order for a specific customer.

When using JPA as a technology, it allows you to maintain access to the database at the same level. This layer can be used by EJB, a web application (Servlets, JSP, JSF), web services, and even a swing application. This will support the database access logic in all of these applications. Then changes to the database will require changes to the JPA.

This is a very simplified explanation of the differences, and this subject is really deep, but these points should help you distinguish between them.

By the way, the new EJB specification really makes beans very easy to use, develop, and deploy. I am fortunate to have missed the original specification all these years ago. They are currently very easy to use.

Hope this helps clear the fog a bit.

+1
source

Source: https://habr.com/ru/post/917425/


All Articles