Hacker News new | ask | show | jobs
by m_0x 1002 days ago
It's the same thing with Hibernate.

Hibernate is an (extended) implementation of JPA. But that's because Hibernate innovated so much that they forced JPA to be better.

Leaving aside the ORM-love-hate discussion, you will do fine if you go with a JPA approach using Hibernate as the implementation. You should (theoretically) painlessly switch to another implementation.

1 comments

Actually, a friend just went through this. A long time user of Glassfish/Payara and EclipseLink. But he wanted to do some specific things with multi-tenancy that had better support in Hibernate for the way he wanted to do it. EclipseLink has multi-tenant extensions as well, but didn't support exactly what he wanted to do. So he switched. He didn't have to toss out his platform implementation (Payara Microprofile I believe) just the JPA implementation it was using.

All of his other JPA stuff ported over, the multi-tenancy is on the edge of it. The whole point is most of his code is ignorant of the multi-tenant aspect. But, also, the JPA spec itself is silent on multi-tenancy, so it's no surprise that the implementors are trying their own approaches. I have to assume that whenever the next JPA spec comes out, it will take inspiration from all of these different implementations and come up with a mechanism to standardize support for them.

So, while he's now "locked in" to the Hibernate implementation of JPA, he didn't have to toss out JPA itself, or his platform. If/when JPA catches up, he may well be able to have the option to switch away from Hibernate if he chooses.