Tags
Authors
Since the JSR-220 Expert Group introduced annotation-based dependency injection and the Java Persistence API as part of Java EE 1.5, it’s been possible to inject an EntityManager
or EntityManagerFactory
into most Java EE components using the dedicated @PersistenceContext
and @PersistenceUnit
annotations respectively.
Later, my JSR-299 Expert Group introduced a completely new approach to dependency injection, which ultimately came to be named Contexts and Dependency Injection for Java. Initially very controversial, CDI has over time become central to the Java EE platform—oops, I mean, Jakarta EE—and other technologies have adopted CDI, now in its sixth revision, as the base-level component model.
But back in CDI 1.0, I needed a way to bridge the gap between @PersistenceContext
and the @Inject
annotation supported by CDI.
And with CDI itself mired in FUD, I wasn’t exactly in a very strong political position to go asking the EE platform group to redefine their, at the time, pretty much brand-new dependency injection annotations in terms of the crazy new direction we were taking with CDI.
I had so many interesting new things to talk about in the summary of Jakarta Persistence 3.2 that I forgot to mention an important thing we’re taking away.
Cross-posted from Substack.
One of the most important experiences of my career was working with Linda DeMichiel from Sun, Mike Keith from TopLink, Evan Ireland from Sybase, and others, to design and write the first version of the Java Persistence specification.
Today this technology enjoys broad acceptance, even among former critics. But in recent years, despite a name change to Jakarta Persistence, the spec has not evolved rapidly. Not until now, that is. Over the last year or so, Lukas Jungmann from Oracle and I have been working rather hard to bring you the biggest release of Persistence in a long time.
This post will concentrate on new features we’ve added to Jakarta Persistence. It’s worth mentioning that quite a lot of work has gone into clarifying the semantics of existing features, and rewriting certain sections of the spec for clarity and readability. This is an ongoing effort. The spec is more than 500 pages in length; rewriting such text without accidentally changing its meaning is a slow and painstaking process.
In a previous post I talked about Jakarta Data. Alignment of the two specifications has been a further priority.