An example of creating a Master-Slave Biskit relationship. This type of relationship is needed if there are going to be a large number of pieces of data to be stored in effectively one table. MySQL has a limit of about 1000 columns to a table, so if more are needed, Biskits that are completely linked together will need to be created. Where if a record is created in one an equivalent record will be created in the other and they will be referenced through the same key.
The Master-Slave that will be created will have only one property on the Master (Name of type String), once this has been created then all the properties needed, can be added to each of the Biskits. A Master could have many Slave Biskits as required, a property needs to be set up on the Master to point to each Slave. Each Slave just needs one property to point to the Master. The Primary Key Column Name in the Slave MUST be different to that in the Master. If there are multiple Slaves then the Primary Key Column Name in each Slave MUST be different.
1.Go to Admin->Bakery.
2.Click the + next to Biskit Def to open the Biskit Tree
3.Select any Biskit.
4.Press the Create button to create a new Biskit and enter edit mode.
5.Update the meta-properties of the Biskit.
a)Change Type to be the new BiskitDef name, in this case PatientInfo.
b)Change Group to make it easy to find all the new BisketDefs using the Filter Biskit Group... button
c)In Properties Add New
i.Change Name to Name
d)Change Name Property on the BisketDef to point to the new Name property
6.Create a new property.
a)Change Type to Biskit.
b)Change Name to Slave.
c)Change Biskit Def to Biskit Def (The other BisketDef is not know yet because we have not created it so use this as a holder).
7.Press the Save button.
8.Press the Create button to create a new Biskit and enter edit mode.
9.Update the meta-properties of the Biskit.
a)Change Type to be the new BiskitDef name, in this case PatientInfo2
b)Change Group to make it easy to find all the new BisketDefs using the Filter Biskit Group... button
c)Change Primary Key Column Name to id1 (must be different from the Master BiskitDef Primary Key Column Name)
10.Create a new property.
a)Change Type to Biskit.
b)Change Name to Parent
c)Change BiskitDef to Patient Info
d)Change Biskit Property Type to Slave To Master
11.Press the Save Button. There will be an error, Save Despite Errors.
12.Select the PatientInfo Biskit and press the Edit button to get back into edit mode.
13.Select the Slave property.
a)Change Bisket Def to PatientInfo2.
b)Change Biskit Property Type to Master To Slave
c)Change Inverse Property to Parent
14.Press the Save button. There will be an error, Save Despite Errors.
15. Select the PatientInfo2 Biskit and press the Edit button to get back into edit mode.
16.Select the Parent property.
a)Change Inverse Property to Slave
17.Press the Save button.
18.If there are no errors the database will need to be updated:
a)Press Update DB Schema to implement changes in the DB, and then run the script to apply the changes
b)Press Validate Biskits button to check the database Biskits
c)Press Reload Database Configuration, to load the new database into Calpendo
d)Refresh the browser