Hi Michael,
I agree that requiring someone's idea of best practice for
portability should not be a requirement, so I am inclined to withdraw
the proposal. But I think we do need to add words to the
specification that says how to interpret the lack of a <primary-key>
element inside a <join> element.
I propose that the TCK should specify primary keys for join tables
used for set elements and map keys of embedded objects where there is
no obvious primary key column to use. This should be portable, but I
don't think we need to make any explicit notation in the specification.
I also like your idea that a missing <primary-key> element means that
there is no primary key on the join table. Some applications might
need a primary key; some might not.
Craig
On Nov 23, 2005, at 9:31 AM, Michael Bouschen wrote:
Hi Andy,
I think I now understand your point, which I missed earlier. You
don't see a need for a primary key to be defined on a join table.
Apparently, JPOX requires this, and there is nothing in the spec
currently that addresses the issue at all. Unless we change the spec
to disallow the JPOX implementation, it seems that it is de facto a
portability issue.
Hi Craig,
I mentioned this in one of the original JIRA issues on this
subject. Either we define a <primary-key> (to fully-specify the
columns to be used, as you say in your proposed wording) or we
have a way of defining that no PK is to be defined for that join
table. I've no problem with allowing both, which is what Abe is
asking for.
I agree JDO should allow both.
JPOX can implement both, but the spec doesn't define how to say
that you have no PK, so consequently how can we ?
We could interpret no <primary-key> element as saying no PK, but
I'm of the opinion that having a PK in a join table is a "best
practice" and should be the default behaviour. Consequently I want
a different way to say that there is no PK. Maybe something like
<join primary-key="false">
I'm not sure whether having a PK in a join table is "best practice"
in general. I think this depends on the data structure. I agree in
case of a map, because the key needs to be unique and the same
holds true for sets. But for others the PK on the join table does
not add much value, does it?
I'm in favor of interpreting a missing <primary-key> element as
there is no primary key on the join table.
Regards Michael
--
Michael Bouschen [EMAIL PROTECTED] Engineering GmbH
mailto:[EMAIL PROTECTED] http://www.tech.spree.de/
Tel.:++49/30/235 520-33 Buelowstr. 66
Fax.:++49/30/2175 2012 D-10783 Berlin
Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:[EMAIL PROTECTED]
P.S. A good JDO? O, Gasp!