r/programming • • Sep 15 '20

Java 15 released!

https://jdk.java.net/15/
214 Upvotes

130 comments sorted by

View all comments

Show parent comments

-5

u/x6060x Sep 15 '20

I'm not sure if you are joking. Especially without the /s tag.

1

u/Prod_Is_For_Testing Sep 16 '20

Very useful for database generation and automation.

0

u/[deleted] Sep 16 '20

[deleted]

4

u/Atulin Sep 16 '20

While ORMs are great for simple CRUD with joins and stuff, they don't really support things like stored procedures, or even views all that wall. And if you have a code-first approach and want to have a procedure in your migration, you have to hand-write it.

3

u/nutrecht Sep 16 '20

While ORMs are great for simple CRUD with joins and stuff

So is plain SQL. Whenever stuff gets complex you hand-written SQL that is checked with the query planner is almost always better and easier to maintain than an ORM.

Secondly; ORMs get used as an excuse to not even look at the generated SQL anymore. In my 20 years experience as a Java dev, pretty much every implementation I came across suffered from thge N + 1

You're much better off using a simple object mapper togeter with plan SQL, or something like JOOQ IMHO.

0

u/[deleted] Sep 16 '20

[deleted]

2

u/Prod_Is_For_Testing Sep 16 '20

Most companies build systems around the database, not the code. So it’s very common, and even encouraged, to integrate existing procs in the code