Another way to do this is, you can define your column as "Sequence" (something like that - Google for it) in your Database table. As soon as you insert record into this table, database will generate the sequence for you.
This one has few drawbacks,
You cannot map this column to Pega property as Pega doesn't have property of type "Sequence".
You'll have to write SQL manually to update this table
May be you can create a view by type casting sequence to text and then have a different mapping in Pega for reading dat (not writing).