db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andy Jefferson (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JDO-211) SQL Exception: 'ADPT_PK_IDX' is not a column in table or VTI 'APPLICATIONIDENTITY0.HASHMAP_OBJECT0_STR'.
Date Sat, 12 Nov 2005 06:17:03 GMT
    [ http://issues.apache.org/jira/browse/JDO-211?page=comments#action_12357480 ] 

Andy Jefferson commented on JDO-211:

Hi Michelle,
I'm not convinced that it's a JPOX bug here. I'll explain why

Let's take the example of MapStringValueCollections, and its field "MapOfObject_String3".
This is defined as
a Map field with join table and with key of SimpleClass, value of String. Both key and value
are embedded, so the join table will have
* FK back to the owner table (IDENTIFIER)
* column for the value
* column(s) for the key fields
This is all well and good, but is missing one thing. JPOX needs to put a PK on the join table.
What are you proposing that it uses ? It doesnt have an id for the (embedded) SimpleClass
key. So it needs something else - and in this case it adds this ADPT_PK_IDX column.

Is there a field in the key class (SimpleClass) that would give uniqueness ? e.g "ID" ? In
that case you should define the <primary-key> on the join table to be formed by IDENTIFIER
and ID. This should be enough to stop JPOX adding its own PK adapter column (and if it doesnt
prevent it then it is indeed a bug in JPOX). If there isn't a field of that nature then you
have to have the ADPT_PK_IDX, or the JDO impl needs to be told somehow that it should not
create a PK on the join table (which should be the last option IMHO since its a best practice
to have one).

I noticed that in the TestHashSetCollections/TestSetCollections you added <order> which
avoided this issue. This means that you have a HashSet/Set that can't contain duplicates (since
its a Set), and a datastore representation that *can* have dups. Using a join table primary-key
specification (like that above) there would have been better IMHO.

> SQL Exception: 'ADPT_PK_IDX' is not a column in table or VTI 'APPLICATIONIDENTITY0.HASHMAP_OBJECT0_STR'.
> --------------------------------------------------------------------------------------------------------
>          Key: JDO-211
>          URL: http://issues.apache.org/jira/browse/JDO-211
>      Project: JDO
>         Type: Bug
>   Components: tck20
>     Reporter: Michelle Caisse
>     Assignee: Andy Jefferson

> Test*MapStringValueCollections there is a mismatch between orm and schema.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message