Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does AppEngine HR Datastore auto assign negative IDs?

I am using AppEngine with the HR Datastore and my Objects have IDs of type Long (using Java). I do not set the ID myself but let the Datastore choose a new unique one. So far I have only seen positive IDs generated.

Does AppEngine also assign negative IDs ever? (assuming that I do not request more than 2^63 IDs of course ;-))

like image 603
Daniel Avatar asked May 02 '26 22:05

Daniel


1 Answers

allocate_id_range (the Python method to preallocate ids) will throw an exception if you pass it negative values. So I guess that a negative id key is not a valid one.

like image 200
Shay Erlichmen Avatar answered May 05 '26 13:05

Shay Erlichmen