Purely out of curiosity, I was hoping someone could explain how ORMs (like Hibernate or Entity Framework) determine the order that they need to execute SQL UPDATEs, INSERTs and DELETEs. Is there an algorithm for building up a topological dependency graph? Or do they cheat somehow and temporarily turn off constraints? Either way, a high-level explanation would be appreciated.
How do ORMs order commands to prevent constraint violations?
orm