Help with storing object keys in a session using JDO/App Engine
I'm new to JDO/App Engine and looking for some help with storing keys of objects in my current session. I've created the following class and would like to access this key in another class?
@PersistenceCapable(identityType = IdentityType.APPLICATION )
public class Register {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY, mappedBy = "Game")
priv开发者_JAVA技巧ate Key userkey;
@Persistent
private String userName;
@Persistent
private String firstName;
@Persistent
private String age;
public Register(String userName, String firstName, String age) {
this.userName = userName;
this.firstName = firstName;
this.age = age;
}
You can make a public Key getKey() { return key; }
method that external functions can call for access to the Key. It's just a normal Java object.
精彩评论