Hacker News new | more | comments | ask | show | jobs | submit login

By reading this I have the feeling it's like saying "You have to know every technical part of your car in detail before you drive it". I'm thinking that in a complex project you don't have time to do that... some people just want to drive but not think about it too much. Seems Hibernate has too many pitfalls if you are in hurry to develop something and you are not doing performance measuring (and beeing able to tune it) in every step of development.

So don't use Hibernate if you are not an Hibernate expert?!

For a fixed amount of effort, you'll do better with Hibernate than without. But if you're an SQL expert and a Hibernate novice you should probably stick to SQL, or else accept that you're going to have to take some time learning (just as if you were to start using e.g. Cassandra you wouldn't expect to immediately be as effective with it as you were with SQL).

And don't expect to mix SQL and Hibernate operations freely in the same code, any more than you'd expect to freely mix e.g. encoding-aware String operations and manipulation of the underlying bytes. It's possible to make good use of the fact that Hibernate is implemented in SQL, CQRS-style: use Hibernate for your "live" operations in your application, use SQL for reporting/aggregation and ad-hoc querying, playing to both their strengths. But don't try to interleave them, especially in the same transaction.

No, don't use Hibernate if your solution to ignoring your tools is writing your own half-assed workarounds rather than take the time to read documentation and ask the right questions.

People do this with SQL all the time; they see queries that aren't "fast enough" and they add indexes everywhere, or they "nudge" the query planner the wrong way, or anything else than to accept that maybe their data was wrongly modeled in the first place, or maybe they need to remove indexes, or actually, you know tune the DB.

Applications are open for YC Summer 2019

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact