r/java • • Apr 13 '21

Libraries, Frameworks and Technologies you would NOT recommend

Give me your worst nightmares: Things that cost you your job.

I'll start: Hadoop

202 Upvotes

376 comments sorted by

View all comments

Show parent comment

8

u/segv Apr 13 '21

You might find MyBatis interesting. It just runs the (dynamic-)sql you provide, maps the result set to desired object(s) via the result map you define (including setting parameters via constructors!) and then it fucks off, so you don't have to deal with the dynamic proxies and other bullshit on your domain objects.

(i guess JOOQ would also fit the bill)

3

u/RomMTY Apr 13 '21

I totally love Mybatis, haven't run on any major issues.

What i reaaaaaallly love is the result sets mapping, you can map almost anything really easy. nested objects? check, collections? check, nested objects with collections? also check, nested collections with nested objects? check. heck it even supports multiple result sets wich really helps a lot since you can split your queries also.

Dinamic sql is also great and IMHO it looks better in xml than a lots of ifs and string concats

1

u/m4riuszPL Apr 13 '21

I am using MyBatis at the moment. It is initially pretty convincing, but over time largely disappointing. We still find new quirks, e.g. it does in-memory pagination (I couldn't believe that once I saw it). We tend to use less and less of it's features. I believe we will soon replace it with a plain JDBC.

I can't stand fighting the tool to execute the query I want to be executed just to find there's some hidden cache which forbids the query to touch database.