UUIDs for DynamoDB?

前端 未结 6 1069
滥情空心
滥情空心 2020-12-14 00:02

Is it possible to get DynamoDB to automatically generate unique IDs when adding new items to a table?

I noticed the Java API mentions @DynamoDBAutoGeneratedKey so I\

6条回答
  •  时光取名叫无心
    2020-12-14 00:50

    Here is another good method taken from mkyong

    http://www.mkyong.com/java/how-to-get-current-timestamps-in-java/

    I adjusted his method to get the milliseconds instead of the actual date

    java.util.Date date= new java.util.Date();
    System.out.println(new Timestamp(date.getTime()).getTime());
    

提交回复
热议问题