I am just learning JDO and GAE, and have gotten myself very stuck on this.
I have gone from having just
public class Article {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key key;
...
}
To now also having a parent:
public class ArticleCollection {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key key;
private long count
private Set<Article> articles;
}
However after doing this, the following code to fetch an article by id no longer works. How do I uniquely identify an object?
Article article = (Article)pm.getObjectById(KeyFactory.createKey(Article.class.getName(), id));
Any help much appreciated!