Make Entity saving actually respect foreign key constraints.