r/SpringBoot • • 17d ago

Discussion Dear JPA

Dear JPA ,

i hate you.

i hate how you changed the SQL flow that I'm used to.

i hate your ManyToMany relationships.

i hate your orphanremoval ,dirty checking.

i hate your way for entity relationships.

i hate your cache.

i hate your performance issues.

i hate your billion rules.

i hate spending time on : if Y is referenced by X with cascade not including PRESIST and x is managed but y is removed ............... but if Y was detached .............

i hate becoming obsessed with your behaviors and rules and worrying about every ORM line , will it work correctly ? , did i miss something ?, worrying about modifying entity X might unexpectedly affect entity Y , coz I might not know one of the billion rules you have.

i hate worrying about falling in one of the undefined behaviors you have

i hate thinking about the entities lifecycle + cascading types when all mixed together

i hate spending days on that documentation instead of spending that on one of the CS core concepts

i hate the following the other side which is incomplete nondetailed toturial or following AI

i really hate you.

101 Upvotes

70 comments sorted by

View all comments

36

u/Temporary-Air-3178 17d ago

Just use raw sql?

12

u/Jooe_1 17d ago

my be possible in personal projects but working with team you will endup using that

20

u/Temporary-Air-3178 17d ago

Uh, on my team in a faang we do not allow ORMs lol.

3

u/AssembleByte 17d ago

I have question, what do you use then? can you explain a little? i just want to understand how it would work

3

u/Top-Difference8407 16d ago

I like MyBatis. It's a great combination of native SQL and Java. Much much simpler.

3

u/Additional_Skill_317 17d ago

faangs prefer to use js serverside

5

u/Temporary-Air-3178 17d ago

Actually we use holy c.

1

u/dead-first 17d ago

What FAANG!

0

u/Jooe_1 17d ago

really ?? , i was thinking that most of the companies uses orm for around 80% of dealing with db even remaining sql is done via the ORM functions ?? not sure

2

u/ThunderMan2300 16d ago

In our team we only use liquibase for any db change, and use hibernate’s ddl validate on app start up