Share

S.O.D.A. - Simple Object Database Access

The forum address has changed, you have been automatically redirected. Please update any bookmarks to use the new URL.

Subscribe

Query implementations I've known and loved

You are viewing a single message from this topic. View all messages.

  1. 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
< Previous | 1 | Next >

Add a Reply

This forum does not allow anonymous participation.

Log in to add a reply. Not registered? Create an account to participate and receive email updates when replies are posted to this topic.