What about using an extent and having both types extend it.  It would pick
the right class based on whichever table has an item with that primary key.

Daniel.

> -----Original Message-----
> From: news [mailto:[EMAIL PROTECTED] Behalf Of Sebastian
> Sent: 02 June 2004 17:07
> To: [EMAIL PROTECTED]
> Subject: Re: Mapping question
>
>
> To simplify my question:
>
> I have a table containing a foreign key column and the foreign key of a
> row points to different tables based on the first three letters of the
> foreign key. E.g. when it starts with "art" then it points to a record
> in the article table. When it starts with "cat" then it points to a
> category table.
>
> This means OJB should based on the first three letters of the foreign
> key know what kind of object to reference.
>
> What kind of custom mapper or converter or whatever do I have to write.
>
> Thanks,
> Sebastian
>
>
> Sebastian wrote:
> > Hi,
> > I'm trying to map some tables with OJBs but don't know how to express
> > their relation. Maybe someone can give me a hint.
> >
> > I have three tables:
> > articles with OID as primary key
> > categories with OID as primary key
> > custom_fields with OID as primary key, OID_FK as foreign key
> >
> > OID is generated uniquely over all tables in a format: "first 3 letters
> > of the table name" plus a "incrementing value". E.g.
> > cat01,art02,art03,cus04.
> >
> > An article as well as a category can have a custom field that is stored
> > in the custom_fields table, the OID_FK is the OID of the
> related article
> > or category. The first three letters of OID indicate the "object type"
> > article or category.
> >
> > How do I have to configure the repository.xml so that always the right
> > object (a category or an article) is referenced by an
> customField object?
> >
> > Thanks in advance,
> > Sebastian
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to