Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

In case of parent-child relationship, how to traverse back and forth?

0
10 Posted

In case of parent-child relationship, how to traverse back and forth?

0

If by Convention over Configuration/from DAS Config there is a name to a relationship, the opposite relationship is named with _opposite appended to it. e.g. Consider two tables (CUSTOMER, ORDER) each with a PK named “ID”. Also, ORDER has a FK named CUSTOMER_ID. The DAS recognizes this convention and assumes a one:many relationship between CUSTOMER and ORDER. In the fully dynamic case, a read of CUSTOMER and ORDER tables using a join will result in a graph of CUSTOMER DataObjects along with their related ORDERS.(name of relationship is ORDERS now.) The property for the CUSTOMER Types list of ORDERs is named “ORDER” so: DataObject order = cust.getDataObject(“ORDER1”); The name of the property in the ORDER Type that references the parent CUSTOMER, is DataObject cust = order.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123