←back to thread

121 points b-man | 2 comments | | HN request time: 0s | source
Show context
madduci ◴[] No.44026546[source]
Many of the principles and also the example provided for PED cannot be mapped easily through an ORM library and AFAIK Java JPA doesn't handle it too.

Why does it matter? I have seen that many developers rely totally only on the code to manage entities on the database, instead of relying on prepared statements and pure SQL queries. This obviously opens a door for poor optimisation, since these Entity Management libraries don't support certain SQL capabilities.

replies(1): >>44026587 #
1. jbverschoor ◴[] No.44026587[source]
That’s non argument. Just use a better ORM. Hibernate is able to do that for about 20 years.

That said, I’m not a fan of natural keys as primary keys. Especially composite keys. This just takes everybody back to the 80s/early 90s.

It only makes sense when there’s a huge storage benefit

replies(1): >>44030026 #
2. javcasas ◴[] No.44030026[source]
Find me an ORM that can do:

* window functions

* SELECT FOR UPDATE

* row-level security

Prepared statements and query builders are the better ORM.