views:

90

answers:

3

Hi there,

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,

+3  A: 

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

TooAngel
+2  A: 

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.

Adam Bernier
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?
daemonfire300
@daemonfire300 IDs are _unique_, just not _sequential_.
Nick Johnson
+4  A: 

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.

Wooble