As for your main question,
I assume  from the API  :: Key =   A datastore GUID. A Key instance
uniquely identifies an entity across all apps, and includes all
information necessary to fetch the entity from the datastore with
DatastoreService.get(Key).

you can get an entity by key:
 Entity get(Key key)
          Retrieves the Entity with the specified Key.

which is convertable to String using the KeyFactory's keyToString(Key
key) function
or convertable to  long using the Key getId()  func




On Nov 16, 4:46 am, elvin <e.v.c...@gmail.com> wrote:
> Good day.
>
> As far as documentation states, "The key value includes the key of the
> entity group parent (if any) and either the app-assigned string ID or
> the system-generated numeric ID. To create the object with an app-
> assigned string ID, you create the Key value with the ID and set the
> field to the value. To create the object with a system-assigned
> numeric ID, you leave the key field null."
>
> Is this the id that can be accessed via Key#getId() call? I assume it
> is.
>
> My main question is: is this numeric ID guaranteed to be unique for
> all entities of the same type?
>
> If yes, how do you retrieve the entity using this id? I tried using
> PersistenceManager#getObjectById(), but it does not find my entity. I
> guess this is related to the fact that my entity is child in an entity
> group, thus its keys' string representation would not be "MyClass
> (10)" (which is created when I use KeyFactory to create key from an
> entity type and a numeric ID) but "MyParent(20)/MyClass(10)".
>
> Thanks in advance,
> Evgeny.

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=.


Reply via email to