Association

Overview

Association represents the parent-child relationship between two tables. The specification of an association includes the followings.

Property Type Description
name string Name of the Association
class2Name string Parent Class
type string Type of the association {Many_To_One, One_To_One, Many_To_Many}
myAttr string Attribute name in the child class
class2Attr string Attribute of the parent class

Sample JSON representation

"associations" : [
    {
      "name" : "files",
      "type" : "MANY_TO_ONE",
      "dir" : "CLS1_TO_CLS2",
      "class2Name" : "File",
      "orderBy" : "createdAt desc",
      "size" : 10,
      "start" : 1,
      "where" : "parentId='{{{id}}}'"
    },
    {
      "name" : "logs",
      "type" : "MANY_TO_ONE",
      "dir" : "CLS1_TO_CLS2",
      "class2Name" : "AuditLog",
      "orderBy" : "createdAt desc",
      "size" : 10,
      "start" : 1,
      "where" : "parentId='{{{id}}}'"
    },
    {
      "name" : "claims",
      "type" : "MANY_TO_ONE",
      "dir" : "CLS1_TO_CLS2",
      "class2Name" : "Claim",
      "orderBy" : "createdAt desc",
      "size" : 10,
      "start" : 1,
      "where" : "parentId='{{id}}}'"
    }