I just started fooling around w/ GAE this weekend.
I have a Categories class and a CategoryGroup class. The idea is that
every category must be grouped. For example the CategoryGroup
"Entertainment" can be assigned to many Categories, such as "movies",
"music" and "television".
Here are my classes.
@PersistenceCapable
public class Categories
{
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key Id;
@Persistent
private CategoryGroups Group;
@Persistent
private boolean IsDeleted;
@Persistent
private String Name;
@Persistent
private Date CreateDate;
@Persistent
@Column(allowsNull="true")
private Date ModifiedDate;
}
@PersistenceCapable
public class CategoryGroups
{
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key Id;
@Persistent
boolean IsDeleted;
@Persistent
String Name;
@Persistent
Date CreateDate;
@Persistent
@Column(allowsNull="true")
Date ModifiedDate;
}
First I add a record to CategoryGroups. When I query all, the reult
is :
CategoryGroups(2)
Next, I add a record to Categories. When I query all CategoryGroups,
the result is :
Categories(3)/CategoryGroups(4)
CategoryGroups(2)
I do not doubt that this works as it was designed to, however, coming
from a RDBMS background, this is very confusing to me. The screen I
created to manage Categories now has "Entertainment" listed twice in
the CategoryGroups select box. Is there a better approach to achieve
my goal?
Any advice is much appreciated.
--
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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine-java?hl=en.