Take the 2-minute tour ×

I currently work with Google's AppEngine and I could not find out, whether a Google DataStorage Object Entry has an ID by default, and if not, how I add such a field and let it increase automatically?


share|improve this question
The "start a bounty" function seems to be active on this question, but it is already answered.... –  Julius F Jun 22 '10 at 12:46
add comment

3 Answers

up vote 3 down vote accepted

Yes, they have id's by default, and it is named ID as you mentioned.

share|improve this answer
add comment

An object has a Key, part of which is either an automatically-generated numeric ID, or an assigned key name. IDs are not guaranteed to be increasing, and they're almost never going to be consecutive because they're allocated to an instance in big chunks, and IDs unused by the instance to which they're allocated will never be used by another instance (at least, not currently). They're also only unique within the same entity group for a kind; they're not unique to the entire kind if you have parent relationships.

share|improve this answer
add comment

I'd also add that, per the documentation, the id is not guaranteed to increase:

An application should not rely on numeric IDs being assigned in increasing order with the order of entity creation. This is generally the case, but not guaranteed.

share|improve this answer
How do I manage none unique entries, instead of using IDs, I mean, "Peter can have John as friend" as well as "George can have a different John as friend" Names are the same, difference would rely on an ID? –  Julius F Jun 20 '10 at 9:23
@daemonfire300 IDs are unique, just not sequential. –  Nick Johnson Jun 20 '10 at 10:34
add comment

Your Answer


