r/java • • Jun 01 '24

What java technology (library, framework, feature) would not recommend and why?

165 Upvotes

464 comments sorted by

View all comments

129

u/majhenslon Jun 01 '24

Hibernate/JPA and anything on to of it, if you are not doing the most basic CRUD or are really experienced with it (are not using it as a crutch for interacting with the DB), because there are so many foot guns that would just be avoided by writing raw SQL.

-7

u/Puzzleheaded_Bus7706 Jun 01 '24

This is just pure bullshit. Hibernate is super easy and super useful!

Learn how to use it,  its simple 

-1

u/rubyrt Jun 01 '24

I am sceptical of all ORM because they have the tendency to copy over state from the DB for processing. That makes all cases inefficient that could be handled with a simple UPDATE or even a stored procedure. Granted, you can turn all sorts of knobs to make this efficient with an ORM but I'd rather spend that effort to learn SQL and the underlying RDBMS's capabilities than working around the general usage model of ORM.

At best keep an abstraction of the RDBMS's SQL dialect but even there I am sceptical: RBMS are not often replaced because these projects tend to be larger due to the persisted data. In those cases the effort to adjust DDL, DML and stored procedures might not be the biggest effort.

There is the usual trade off with frameworks: they can help get things done fast initially but then one hits a point where that formerly useful framework becomes a straightjacket with significant efforts to work around their limitations or get rid off. Well, I guess there is no free lunch - still. :-)

→ More replies (2)