gavin wrote:
Well, you could model the table as an entity with two <any>s. Querying it is going to be difficult though. This is a pretty awful model....
Okay, thanks for that lead. Yes, I see that does look like something
interesting. Since I've got to force each link to believe a
descriminator, it seems to fit my needs. Where it says "The first column holds the type of the associated entity. The remaining columns hold the identifier. " (manual section 6.4) All I have to do is provide a mapping for the little string in the database to a .class of the right kind which would be
one of my 'real' tables of entities
So then the other end, back at the well behaved People, Places, Books and Image, becomes a .. ahhh ... one-to-any? But there isn't
one of these, so I'm thinking it's maybe an <idbag ... > again with
the appropriate "where" attribute to pick up that descriminator correctly.
Note: In each regular table I had previously operated with Links that come from and links that come to the record, so there would be an <idbag ...> or
just <bag ....> for each of those associations.
So what are the challenges of querying?
Actually, in the previous version of this application, I generally
started out at one 'real' entity and generally navigated through
this funcky table: All Locations with links to Images, or All People with links to a particular Location. That kind of thing, but a future requested
feature is queries which narrow the lists across combinations of
People, Places, Books etc. e.g. Books from Places which have People who contain the text 'foo'. Note that this would pass right through this link
table twice in the same query which would be People to Links to Places to
Books.
Thanks again for the quick feedback!
-Paul