Re: Beginner question about JDO best practice
- From: Sven <sj1981@xxxxxxxxx>
- Date: Thu, 20 Dec 2007 07:53:41 -0800 (PST)
On 20 Dez., 16:02, Dyreatn...@xxxxxxx wrote:
But presumably the 'name' column is declared 'UNIQUE' for a reason?
Allowing you to just add tag3 would violate the unique-ness,
wouldn't it? If you don't really need them to be unique after all,
shouldn't you change the table definition to reflect that?
To simplify matters I didn't explain the whole situation but I guess
this is necessary now:
Let's say we have another class, for example a "BlogEntry" class,
which contains - among other things - a Set of Tag objects. Since
there can be many BlogEntry and Tag instances I want the tags to be
unique in the database scheme. blog entries and tags are related to
each other via a join table which contains the columns "blog_id" and
"tag_id".
What I was hoping for is that JDO automatically handles the uniqueness
of tags when persisting a BlogEntry object with n Tag objects and
inserts the right ids into the join table.
.
- Follow-Ups:
- References:
- Beginner question about JDO best practice
- From: Sven
- Re: Beginner question about JDO best practice
- From: Dyreatnews
- Beginner question about JDO best practice
- Prev by Date: Re: Beginner question about JDO best practice
- Next by Date: Re: Beginner question about JDO best practice
- Previous by thread: Re: Beginner question about JDO best practice
- Next by thread: Re: Beginner question about JDO best practice
- Index(es):
Relevant Pages
|