Re: [Objectbridge-developers] optional relationships
Brought to you by:
thma
From: Dirk O. <di...@xa...> - 2001-08-10 05:00:40
|
David Forslund wrote: > > To illustrate things better I'll just give a short description of my > > tables: I have a table 'Person' which has a to-many relationship to > > the table 'Folder'. The 'Folder' table will later have a reflexive > > relationship to itself (so I can have subfolders to every folder). > > (BTW: is that possible with ObjectBridge right now?) > > Yes, it does. We are using it this way now. One of my applications > has the same structure. It has an "Identity: object which contains many > "Traits" Traits can contain other Traits. I have two tables Identity and Trait [...] > > In order to model that, the 'Folder' table needs a foreign key which > > can be NULL for the case that a folder has no parent folder. > > In my case I don't allow for a Trait to exist by itself, so a Trait > has a Trait or an Identity as a parent. I don't formally use a foreign key. Good to hear that. But how do you do the mapping? I currently have no idea how to accomplish that without a foreign key. Or do you put code into Trait to retrieve the parent? -dirk |