Problems with JPA/Hibernate
This is a common criticism but still extremely shallow. JPA&#x2F;Hibernate is still the best way to actually produce working applications if you have to use an SQL database for some reason. To go point by point:<p>Mutable datastructures with default constructors and setters: yes, mutable entities suck. Unfortunately SQL is fundamentally built around mutable entities. Every field of your POJO is writable because every column of your database is writable. The impedance mismatch is big enough already without trying to make objects that behave differently from your database. Yes, an object shouldn&#x27;t just be a datastructure with methods; unfortunately an SQL table row is just a datastructure, and classes are the only mechanism Java offers for representing such a thing. Same for mutable collections.<p>Reflection (which is the reason classes must be non-final): again, sucks, again, the only way to do something like this in Java.<p>Lazy loading is wonderful. Put your session in your view, write a normalised set of entities that actually model your domain, and get on with your life. Don&#x27;t worry about the details of what loads when unless and until you have to.<p>Those who don&#x27;t understand Hibernate caching are doomed to reinvent it poorly.<p>Don&#x27;t use your database as an API. Yes, Hibernate&#x2F;JPA needs to own your database. That&#x27;s as it should be. SQL databases are way too complex to be shared between independent applications.<p>Do you really think people who can&#x27;t be bothered to learn and understand Hibernate properly are somehow going to take the time to learn and understand &quot;vanilla SQL&quot;? Why?<p>None of the problems listed here are problems of JPA&#x2F;Hibernate. They&#x27;re problems of SQL databases which are surfaced through JPA&#x2F;Hibernate, but if you skip out on JPA&#x2F;Hibernate you still get exactly the same problems (maybe in a slightly less recognisable form). The real solution is to stop using these overrated datastores, but if you must use them then JPA&#x2F;Hibernate is the least-bad way of doing so.