Model: Article can have multiple tags and multiple reviewers

Queries I want to do:

1. Find all articles with a particular tag which I have to review
2. Find all articles that are being reviewed by me and someone else

Model I am thinking:

Article {
  HashSet<Reviewer> reviewers;
  HashSet<String> tags;
}

Now the twist is that reviewers can approve or disapprove the article for
publishing, so I want to show a dashboard where I would do queries like:

1. Articles I still need to review.
2. Articles which you have approved, but haven't been approved by everyone
else (we could be waiting on someone's response or someone could have
declined (you may want to take some action, talk to the other reviewer)).

and I was thinking that there should also be a way to see

3. Articles that I have declined.
4. Articles that have been approved.

I was initially thinking of keeping a HashMap<Key, int> status; kind of a
thing, but then I would have to go through every Article, that can't be
good. I also thought of doing this:

Article {
  HashSet<Review> reviews;
  HashSet<String> tags;
  int status; // derived from all Reviews' statuses.
}

Review {
  Article article;
  Reviewer reviewer;
  int status;
}

I dont think I can do sth like (I can't access article.tags, article.status
as far as I know, correct?):

final Query query = pm.newQuery(Review.class);
query.setFilter("reviewer == reviewerParam && status == statusParam &&
article.tags == tagParam && article.status = articleStatusParam");

So, whats the best way to model this scenario, where should I compromise?

Thanks!

P.S. Also wondering how do people search across all these entities so fast?
Whats the catch?

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

Reply via email to