Child's key is unique in whole app.

I have owned one-to-many relationship between two objects:

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class AccessInfo {
    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private com.google.appengine.api.datastore.Key
keyInternal;
    ...
    @Persistent
    private PollInfo currentState;

    public AccessInfo(){}

    public AccessInfo(String key, String voter, PollInfo currentState)
{
        this.voter = voter;
        this.currentState = currentState;
        setKey(key); // this key is unique in whole systme
    }

    public void setKey(String key) {
        this.keyInternal = KeyFactory.createKey(
                        AccessInfo.class.getSimpleName(),
                        key);
    }

    public String getKey() {
        return this.keyInternal.getName();
    }

and

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class PollInfo
{
    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key key;

    @Persistent(mappedBy = "currentState")
    private List<AccessInfo> accesses;
    ...

I created an instance of class PollInfo and make it persistence. It is
ok. But then I want to load this group by AccessInfo key, and I am
getting exception NucleusObjectNotFoundException. Is it possible to
load a group by child's key?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to