The following objectscript will create the following SQL table:
Objectscript Class
Class MyApp.Parent Extends %Persistent
{
Property Children As array Of MyApp.Child;
}
Parent_Children table and columns:
Parent int NOT NULL,
ID varchar(254) NOT NULL,
Children int NULL,
element_key varchar(50) NOT NULL
When the Parent is saved in objectscript via the %Save() command and the Parent's children property has an element, a row is automatically created in this join table. The ID column has a value like "15||1", the Parent column has the primary key of the Parent row and the Children column has the primary key of the child row.
In SQL, how do I create an insert statement for this table? I do not know how to make the value for the ID column.