 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Joao Morais Guest
|
Posted: Thu Apr 12, 2007 2:51 am Post subject: Object storage dilemma |
|
|
Hello,
I am designing an OPF and an issue was raised. Lets say that I have this
model:
TContact
+-TPerson
+-TCompany
TInvoice
Date: TDate;
Client: TContact;
My TInvoice storage will be at least something like this:
create table Invoice (
Id: Integer;
Date: Date;
ClientId: Integer);
But what about the client class? I can: create another field as a class
reference; or I can create a join between the invoice and the contact
tables in order to retrieve the client class.
Perhaps you say: the id is a unique value inside the whole database. I
agree and like this approach, but (I think) I will need an "instances"
table that will need to be queried or joined, in order to know where I
will find an instance -- in my sample, the Client instance.
Ok, I hope you got what I mean, and I'd like to know your experience in
this area, if you:
- have an instances table and uses join, or another query to know a
class of an Id;
- don't have an instances table but a class reference per table:
create table Invoice (
Id: Integer;
ClassId: Integer;
Date: Date;
ClientId: Integer);
so you query the Contact table (or create a join) to know the class;
- have one class id per object id:
create table Invoice (
Id: Integer;
ClassId: Integer;
Date: Date;
ClientClassId: Integer;
ClientId: Integer);
- another approach?
Thanks,
--
Joao Morais |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|