I am implementing a tag system for a website using JDO. I would like to use this method.
However, I am new to relationships in JDO. To make it simple, I look like this:
@PersistentCapable
class Post {
@Persistent String title;
@Persistent String body;
}
@PersistentCapable
class Tag {
@Persistent String name;
}
What kind of JDO relationships do I need and how to implement them? I want to be able to list all Tagthat belong Post, and also be able to list all Postthat have a given Tag. So in the end I would like to have something like this:
Table: Post
Columns: PostID, Title, Body
Table: Tag
Columns: TagID, name
Table: PostTag
Columns: PostID, TagID
source
share