Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is is possible to do @Unique() inside Java in XPages?

Tags:

xpages

When I want a unique key for documents I'm partial to using @Unique(). I like that it's based on username and time.

Is there a way to get that from inside a Java bean?

If not, what's the best way to get a unique number in Java that would not repeat?

Thanks

like image 822
David Leedy Avatar asked Apr 01 '13 01:04

David Leedy


1 Answers

This is what I use whenever I need a unique number:

String controlNumber = UUID.randomUUID().toString();

like image 79
Russell Maher Avatar answered Sep 24 '22 12:09

Russell Maher