r/javahelp • • Jul 30 '25

Why JPA & Hibernate

Hi everyone, why use JPA and Hibernate?

Currently using it at school. There is a mountain of annotations, and I haven't found a way to debug them yet. And the risk of Jackson JSON Recursion error, and the whole API service just halts to 503; then the query language doesn't help either.

Why JPA?

I had been using Spring Client JDBC previously, and this is the first time using plain JPA and Hibernate. I get that for the `@Column @ id` there are lots of limitations, while plain SQL is so much clearer (verbose, of course).

JPA and Hibernate are neither simple nor easy.

6 Upvotes

21 comments sorted by

View all comments

Show parent comment

2

u/nitkonigdje Jul 30 '25

The bigger the database is, the harder is to keep JPA and/or Hibernate in check. It actually works the best for simplest HelloWorld cruds.

One of the main reasons was: ORM guys wanted to support legacy databases. Not old database software, but old databases designed before ORMs hit Java. Their idea was "we will make possible to map everything". Thus mapping is extremely flexible, but is plagued with context sensitive grammar, and code generation is unpredictable.

The only way to keep Hibernate in check is to build up database specifically for Hibernate, and to have massive amount of experience..