Collection Object

Ruslan Zasukhin sunshine at public.kherson.ua
Mon Jul 31 10:06:02 CDT 2006


On 7/31/06 9:55 AM, "Philip Mötteli" <philip.moetteli at econophone.ch> wrote:

>> In short:
>> 
>> * Each table have RecID and OID
>> 
>> * This kind of "Link to many tables" can be made on OID.
>> 
>> * We have no own kind of link that will support this.
>>     in draft we have new field type "ObjectsPtr"
>>     Note "s" at end of "Objects"
>> 
>>     ObjectsPtr => point OID field of ANY table.
>> 
>>     ObjectPtr  => point RecID field of some table.
>> 
>> * So, you can simply make in your CENTRAL TABLE one field of ULLONG
>> type
>>     (8 bytes) and store here OID values of tables around.
>> 
>> * Now how this works.
>> 
>>     Note that
>>             OID = (TableID << 32) + RecID
>> 
>>     If you have OID value you can easy define TableId,
>>     then get this table by ID and go to RecID of this table.
>> 
>> Let me know if any questions.
> 
> Yes  :-), if I understand that right, this is just one pointer to one
> object? But I have an undefined number of such pointers. Kind of a
> BLOB of OIDs.

Not right.

Let you have tables

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,297
2
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
------------------------------------
                ObjectPtr
------------------------------------
                0x00000010000001
                0x00000020000001
                0x00000030000001
------------------------------------

So when you read value 0x00000010000001.

Where it point?
    
    it point to table with ID = 1 and its record with RecID = 1.



-- 
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