2003-02-27 22:12:54 UTC
Alright, I guess I misspoke my problem in the analogy.
I think I can more correctly state the problem I was trying to (and failed to) illustrate above:
Can I find the group of authors that wrote articles for a particular magazine? I know it can be done in two steps:
Set authors = new HashSet();
Query q = db.query();
q.constrain(Article.class);
q.descend("magazine").descend("name").constrain("MyMagazine");
ObjectSet articles = q.execute();
while(articles.hasNext()) {
authors.add(((Article)articles.next()).getAuthor());
}
But is there a way to accomplish the same through a single query that would return an ObjectSet of Authors?
Sorry if the answer is obvious, but I can't seem to wrap my head around it.
Harry