Where did ORM fail?

I often hear people attack ORM for lack of flexibility and "vulnerability abstraction", but you really don't know why they have problems If used properly, what is the error of ORM? I asked this because I'm working on a PHP orm. I hope it can solve many other ORM failures, such as delayed loading and lack of subqueries

Please specify your answer Show some code or database schema describing ORM struggle Language or ORM doesn't matter

Solution

A more important problem that all ORM's I've used have noticed is that only a few fields are updated without retrieving objects first

For example, suppose I map a project object in my database, which contains the following fields: ID, name, description, owning_ user. For example, with Ajax, I want to update only the description field In most ORM, the only way to update the database table is to retrieve the item object from the database, set the description, and then send the object back to the database (so two database operations are required) just for a simple update) or update it through a stored procedure (which is the method I currently use)

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>