Re: [xml-dbms] Re: Unique key problem
I haven't gotten back sooner because you already had a work-around.
I tried to duplicate this on my machine, but was not able to do so. In
particular, I was able to construct a map that used unique keys instead
of primary keys in RelatedClass elements.
I then looked back at your original email and was not able to find
anything blatantly wrong.
I then checked the code. The error is coming from the xmldbms.maps.Key
class. There are three different methods that return this error and all
are called by the MapCompiler class. It's not clear which one is causing
the error, as your stack trace doesn't show this.
At this point, there's not much else I can do. If you do recreate this
bug, please send me your map file and the full error stack so I can see
if there is a problem in the map files or in the code.
> Thanks Ron,
> As I was in a bit of a hurry, I ended up refactoring some of the
> database tables so that I could use primary / foreign keys in the
> normal way. I didn't keep a copy of my original set of map file
> changes, so my memory of things-as-they-were is a little hazy! What it
> boiled down to (forgetting the "multiple parents" issue, which was
> really a side issue) is that I originally set out to model a
> parent-child relationship in the map file, using <ForeignKey> and
> <RelatedClass> but I ran into problems because the column in the
> parent table that was used as the foreign key wasn't the primary key
> in the parent table. To get around this, I tried specifying it as a
> <UniqueKey> but having done that, I got the error message that I reported.
> So in a nutshell... what I was unable to do was to define a FK
> relationship between two elements / tables where the column in the
> parent table used for the join was not the PK.
> To answer your question about what was happening at the time I got the
> error... I'm not a Java guy, but a colleague tells me that it was
> during our initialisation phase, where the map files are read and we
> are trying to create the "map objects", the in-memory version of the
> map files. Hope that makes sense...