← Back to team overview

mugle-dev team mailing list archive

Re: Getting a Key from a Long

 

Hi Matt,

you can't directly build it from a Long.

However you can use this Long in primary key lookups; you should be able to
just do:
GameVersionGetter.getGameVersion(key);

where key is the integer.

Essentially when you do;
pm.getObjectByID();  you can pass it either the Key or its corresponding
Long (which is generated by Key.getID() just fyi)

On Sun, May 22, 2011 at 11:23 PM, Matt Giuca <matt.giuca@xxxxxxxxx> wrote:

> Hi Prageeth,
>
> You have done this type of thing haven't you? If I have a long which is the
> key ID (from the server), and I know the type of the key, how do I build a
> Key object from that?
>
> Basically I have a URL which has a GameVersion key (as an integer) and I
> need to get the Key to the GameVersion.
>
> Matt
>
> --
> Mailing list: https://launchpad.net/~mugle-dev
> Post to     : mugle-dev@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~mugle-dev
> More help   : https://help.launchpad.net/ListHelp
>
>

References