Any drawbacks of using Hibernate EntityManager (vs. Hibernate Core)?

前端 未结 4 843
借酒劲吻你
借酒劲吻你 2020-12-31 05:35

The Hibernate EntityManager documentation states, that:

You may use a combination of all three together, annotations without JPA programming inter

4条回答
  •  渐次进展
    2020-12-31 06:02

    I like using Hibernate Core directly. I also prefer XML mapping files.

    I'm not really interested in using a secondary layer, to access Hibernate core functionality. As far as I am concerned portability in the persistence tier, is a complete non-issue.

    There are very few real advantages of the JPA API over Hibernate API -- I saw people using JPA named queries (where Criteria would have probably been clearer & better), and the JPA annotations are somewhat better designed.

    Other than that, JPA is just a layer adding complexity & potential overhead -- for no benefit. Architecturally in such a situation, the correct decision would be against using it.

    Database portability OTOH is very real. I have custom allocators (generators) I use which are completely portable, and far more performant & simpler than the crazy mess which is the mis-designed Hibernate ones.

    This approach has been very successful on multiple major commercial, Government & legacy database re-engineering projects. In short -- focus on what's important -- and an API on top of an API, is not it.

提交回复
热议问题