Transactions and Relations¶
A relationship in the Backendless database must be declared as a column in a data table. That data table is referenced in this documentation as the parent table and similarly objects in the parent table are referred to as parent objects.
A relationship column in the parent table points to another table, which we refer to as the child table. Similarly the objects in that table are referenced as child objects or children. Consider a sample table schema below. The schema is for a table called Person
. The table has a relation column visitedCountries
, which represents a 1:N
(one-to-many) relation with objects in the table Country
.
Object relationships make a variety of operations possible. For instance, the example above would enable the following:
- Assigning
Country
objects to an object from thePerson
table; - Adding additional
Country
objects to an existing list of visited countries for aPerson
object; - Removing some or all
Country
objects from aPerson
object; - Retrieving related
Country
objects for aPerson
object;
All operations listed above can be executed in a Backendless transaction using the operations described further in this documentation. It is important though that the relation columns are declared before you run any transaction APIs.