Hi,
I'm creating an encoded key like this:
public static String generateKey(String username) {
return KeyFactory.keyToString(
KeyFactory.createKey(User.class.getSimpleName(), username));
}
is it possible to decompose the key to get the original username out of it?
String encoded = generateKey("bob");
String decoded = KeyFactory.decodeKey(encoded);
// decoded = "bob".
Thanks
--------- Edit: How I'm storing the key -------------------------
@PrimaryKey
@Extension(vendorName = "datanucleus", key = "gae.encoded-pk", value="true")
private String mKey;