Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GUID equivalent for Java (Android)

Having a bit of experience with C# and SQL, I've recently discovered that GUIDs are a much better datatype for IDs than integers are. Therefore we're changing alot of our code to start using GUIDs instead of ints, which will hopefully solve alot of referential problems we encounter in our database design.

At the same time, we are exploring the possibility of having a database system on android phones as well. Since both GUIDs and Java are brand new to me, I was wondering if there is some sort of equivalent data type in java? (I'm not interested in C# compilers for android by the way). Any thoughts would be greatly appreciated.

like image 946
Mike Baxter Avatar asked Jun 12 '13 12:06

Mike Baxter


1 Answers

The Java equivalent is UUID. See http://docs.oracle.com/javase/6/docs/api/java/util/UUID.html.

like image 156
Rob Lyndon Avatar answered Oct 20 '22 08:10

Rob Lyndon