This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Yes. You can do this either using a database specific mechanism. You don't mention the database type, but you could use a sequence, or an identity column, or an autoincremenet column, or a timestamp colum depending on the database. Or you can do this in your app. Its easy enough to do that - you'll need to use some sort of pattern (for example the HILO key generation pattern) to get a value and just update the database accordingly.
If you have an entity that needs a unique, unchanging, not null complaint number; is that not a primary key?