How to make ReStore generate foregein keys on many-to-many relationship tables ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to make ReStore generate foregein keys on many-to-many relationship tables ?

maurel
Hello,

I am starting the developpement of an database application using
Dolphin5,
ReStore and MSAccess.

My object model contains many-to-many relationships, within ReStore those
relationships are named General Collections, and are stored using an
intermediate table.

Inspecting the data model using MSAccess I noticed that those
intermediate
tables don't define any foregein keys.

Is this the normal ReStore mapping ? Is there any limitation due to
MSAccess (I did
not try ReStore with an other database) ?
How to make ReStore generate foregein keys on many-to-many relationship
tables ?


Reply | Threaded
Open this post in threaded view
|

Re: How to make ReStore generate foregein keys on many-to-many relationship tables ?

Bruno Buzzi Brasesco-2
Hi,

I not 100% sure but ReStore use "direct pointers" between tables.
This "direct pointers" are numbers (main key of tables), and they work like
foreing keys.
Example:
Account Table
Number ..... Bank
123              458

In this case 458 is the main key of Banks table.

The same case is used to many to many relationships. But in many to many
relationships you have 2 tables.
So you do not have to define foreing keys thats the trick (i think).
Example:
FactoryProcess and FactorySector as many relationships.
Tables
1. FactoryProcess_FactorySector
2. FactorySector_FactoryProcess

Table FactoryProcess_FactorySector:
Process    Sector
1                2
1                3
1                4

Table FactorySector_FactoryProcess:
Sector    Process
2                1
2                3
2                4

If you want Sectors of aProcess ReStore search in
FactoryProcess_FactorySector table.
If you want Process of aSector ReStore search in
FactorySector_FactoryProcess table.

Remember that ReStore use on demand loader.

I hope this help.

Regards Bruno