Collection Object

Ruslan Zasukhin sunshine at public.kherson.ua
Mon Jul 31 13:20:11 CDT 2006


On 7/31/06 12:54 PM, "Philip Mötteli" <philip.moetteli at econophone.ch> wrote:

>>>> T1 { RecID, OID, a1, a2, ... },   TableID = 1
>>>> 
>>>> T2 { RecID, OID, b1, b2, ... },   TableID = 2
>>>> 
>>>> T1 { RecID, OID, c1, c2, ... },   TableID = 3
>>>> 
>>>> And you need table TC that can point any record of above 3 tables:
>>>> 
>>>> TC { RecID, OID, ObjectPtr as ULLONG, ... }
>>>> 
>>>> 
>>>> -----------------------------------------------------
>>>> First record of T1 has
>>>> 
>>>>     RecID = 1,      OID = 0x00000010000001 = 4,294,967,2972
> 
>>>> First record of T2 has
>>>> 
>>>>     RecID = 1,      OID = 0x00000020000001 = 17,179,869,184
>>>> 
>>>> First record of T3 has
>>>> 
>>>>     RecID = 1,      OID = 0x00000030000001 = 25,769,803,776
>>>> 
>>>> You see?
>>>>     OID = (TableID << 32) + RecID
>>>> 
>>>> 
>>>> 
>>>> -----------------------------------------------------
>>>> Now in TC you can have 3 records:
>>>> 
>>>> 
>>>> TC, TableID = 4
>>>> ------------------------------------
>>>>                 ObjectPtr
>>>> ------------------------------------
>>>>                 0x00000010000001
>>>>                 0x00000020000001
>>>>                 0x00000030000001
>>>> ------------------------------------
> 
> 
> So you mean, I have to create an old fashioned intermediate table TC?
> With intermediate, I mean a table, that only serves to create an M:M
> relation.

No, no no

> NSSet {RecID, OID}, TableID = 5
> 
> First record of NSSet has
> 
>       RecID = 1,      OID = 0x00000050000001
> 
> 
> TC
> ------------------------------------------------------------------------
>                   ObjectPtr                                    ObjectPtr
> ------------------------------------------------------------------------
>                   0x00000050000001                0x00000010000001
>                   0x00000050000001                0x00000020000001
>                   0x00000050000001                0x00000030000001
> ------------------------------------------------------------------------


No, you do not need 5th table!

I have give you FULL complete example:

    Table TC point three tables


>>     CREATE TABLE TC ( objects_ptr as ULLONG, ... Other fields ... )
> 
> With TC you mean "Table Central"? Which should actually be my NSSet
> table?

RIGHT.

My TC - this is table Central, and it play role of YOUR NSSet :-)



-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina mailing list