Generating surrogate keys for objects