开发者

Help with storing object keys in a session using JDO/App Engine

开发者 https://www.devze.com 2023-02-22 16:48 出处:网络
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?

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消