Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Don't people learn the basics of how things work anymore ?!
I am cleaning this project, where some juniors have implemente a lot of the code.
Apparently, the way of deleting an entity from the database is:
1) SELECT the entire row and cast it to a model class
2) CONVERT that model class to a DTO class
3) READ the Id property from the DTO class
4) SELECT the entire row, again, and this time cast it to a DTO class
5) CONVERT that DTO class to a model class
6) Use you pancy-pants ORM delete method using the entire model class as input argument..
FUCK YOU !
inb4 what about reference checks ?
- Nope. That is done separately using only the Id
inb4 what about checking if someone else has altered it before deleting
- Nope, the entire entity is not used for that either.
rant