We assign IDs when the objects are constructed using UUIDs (UUID.randomUUID().toString()). We don't bother with sequences in the database.
UUIDs are loved by some, and dislike by others, but we use them as IDs throughout our system as it is a great way to get a unique ID without needing to hit the database. They do take up a bit more space in the DB and are relatively difficult to read when debugging but I find that the pros far outweigh the cons.
Cheers
Cameron
[Message sent by forum member 'cameronr' (cameronr)]
http://forums.java.net/jive/thread.jspa?messageID=243725