Like I said in the subject, I'm new to app engine and I'm trying to
get my mind in the app engine mode, so pardon my ignorance. I'm using
the java implementation of GAE since I'm also using GWT.

I've done a lot of work over the years with mysql, sql server, etc...
and I think that the knowledge of those systems is clouding my
understanding of GAE. So, please, your help would be greatly
appreciated.

What I'm trying to do is enable tagging in a task management system
that I'm writing. The objective is to allow users to tag tasks but
also, to reduce duplicate tags in the system, have a shared tag table.
What will happen is that when a user tags a task the system would
check to see if the tag already exists in the shared table. If the tag
exists then the user's account and the current task would be linked to
the tag. If the tag doesn't already exist then it would be created and
the user's account and the current task would be linked to the newly
created tag.

I plan on linking the user's account to the tag so that the system
could list all tags associated with their account so that they could
filter the task list by selecting tags, similar to gmail's filter by
tags feature.

So basically, in MySQL I would structure these tables like so:

Account
-------------------
ID
EMail
UserName
ETC...

AccountTagLink
----------------------------
ID
AccountID
TagID

Task
------------------------------
ID
Description
ETC...

TaskTagLink
---------------------------------
ID
TaskID
TagID

Tag
-------------------------------
ID
Description

And the linkages
-----------------------------
Account.ID > AcctTagLink.AccountID
AcctTagLink.TagID > Tag.ID

Task.ID > TaskTagLink.TaskID
TaskTagLink.TagID > Tag.ID

With the above structure I could easily perform a subquery in MySQL
and get all Tags associated with an account. Ex: select * from Tag
where exists (select id from AcctTagLink where AcctTagLink.TagID =
Tag.ID and AcctTagLink.AccountID = <current account id>)

...And I could do a similar query to get all tags associated with a
given task.

I'm not asking for an equivalent structure in GAE (however that would
be nice). I just posted all that so that what I'm trying to do is
perfectly clear. So, my question to you is simply this, "How should I
structure my data in GAE to accomplish the same end result?"

Thanks for reading my wall of text, and thanks in advance for any
help :D

-- 
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-j...@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