That code fails to tell the programmer why it's in the application logic and not defined in the database schema
Why isn't it a GUID? Why is it 32 bits instead of 64? Why is it signed yet starts at 1? Why isn't it a string? How will the identities be merged?
The notion that answering one single question provides clarity is ridiculous.