Question

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?

regards,

Was it helpful?

Solution

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

OTHER TIPS

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.

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top