V4RB2 vLink
Ruslan Zasukhin
sunshine at public.kherson.ua
Wed Dec 29 21:28:20 CST 2004
On 11/22/04 10:32 PM, "erne" <ernestogiannotta at tiscalinet.it> wrote:
> hello Ruslan,
>
> looking into new vLink class and have some questions
>
> we create BinaryLink with DB method:
> DB.CreateBinaryLink(
> inName as String,
> inLeftTable as VTable,
> inRightTable as VTable,
> [inLeftPower as Integer = 1],
> [inRightPower as Integer = 0], // 1 : M
> [inOnDelete as integer = 1],
> [inStorageType as integer = 0], // kDefault
> inTemporary as Boolean = false) As VLink
>
> how can we delete this if we don't need it anymore?
>
> so the vLink object knows the Tables it is linking
>
> but when we want to find linked we must call:
> vLink.FindLinked( inRecID as Integer, inTableA as VTable, inTableB as
> VTable ) as VSet
>
> why must we specify the tables here?
> mmm... I see, we need specify the direction of desired link
Absolutely correct!
inRecID this is RecID of tableA
> so it could also be implemented by index as in:
> vLink.FindLinked( inRecID as Integer, inTableA as Integer, inTableB as
> Integer ) as VSet
But what sense, Erne?
I think pointers on objects is the best choice.
> after all we are required to know the Index order of linked tables if
> we must link records by:
> vLink.LinkRecords( inRecIDs() as Integer )
Agree. Index of table is strict thing.
It correspond to the order of creation.
> anyway, to specify the 2nd table seems redundant as we have:
> vLink.DeleteLinkedRecords( inRecID as Integer, inTableA as VTable )
> vLink.DeleteAllLinkedRecords( inTableA as VTable )
>
> so it should be enough:
> vLink.FindLinked( inRecID as Integer, inTableA as [VTable or Integer] )
> as VSet
I see your point...and
> unless vLink will be able to link more than 2 tables in the future
Exactly! Bingo! :-)
> in which case the LinkRecords, DeleteLinkedRecords and
> DeleteAllLinkedRecords methods must be updated
NO. because when link will have 3 branches, I still can say
vLink.DeleteAllLinkedRecords( inTableA as VTable )
And this means break links to ALL linked tables of TableA.
--
Best regards,
Ruslan Zasukhin [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com
To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------
More information about the Valentina-beta
mailing list