formJoinCri method

String formJoinCri(
  1. DfBaseEntity<DfBaseField> leftEntity,
  2. DfBaseEntity<DfBaseField> rightEntity
)

Implementation

String formJoinCri(DfBaseEntity leftEntity, DfBaseEntity rightEntity) {
  String result = "";
  DfDbEntity leftEnt = leftEntity;
  DfDbEntity rightEnt = rightEntity;
  var leftEntityJoinFields = leftEnt.getJoinKeyFields();
  var rightEntityJoinFields = rightEnt.getJoinKeyFields();

  for (int i = 0; i < leftEntityJoinFields.length; i++) {
    if (result.length > 0) {
      result = ("$result AND ");
    }
    String leftEntityJoinField = leftEntity.entityName + "." + leftEntityJoinFields[i].name;
    String rightEntityJoinField = rightEntity.entityName + "." + rightEntityJoinFields[i].name;
    result = "$result$leftEntityJoinField = $rightEntityJoinField";
  }

  return result;
}