public int compareTo(Object obj) {
    if (obj == null) {
      return (-1);
    } else if (obj instanceof CFCrmAddressBuff) {
      CFCrmAddressBuff rhs = (CFCrmAddressBuff) obj;
      int retval = super.compareTo(rhs);
      if (retval != 0) {
        return (retval);
      }
      return (0);
    } else if (obj instanceof CFCrmAddressByTenantIdxKey) {
      CFCrmAddressByTenantIdxKey rhs = (CFCrmAddressByTenantIdxKey) obj;

      if (getRequiredTenantId() < rhs.getRequiredTenantId()) {
        return (-1);
      } else if (getRequiredTenantId() > rhs.getRequiredTenantId()) {
        return (1);
      }
      return (0);
    } else if (obj instanceof CFCrmAddressByContactIdxKey) {
      CFCrmAddressByContactIdxKey rhs = (CFCrmAddressByContactIdxKey) obj;

      if (getRequiredTenantId() < rhs.getRequiredTenantId()) {
        return (-1);
      } else if (getRequiredTenantId() > rhs.getRequiredTenantId()) {
        return (1);
      }
      if (getRequiredContactId() < rhs.getRequiredContactId()) {
        return (-1);
      } else if (getRequiredContactId() > rhs.getRequiredContactId()) {
        return (1);
      }
      return (0);
    } else if (obj instanceof CFCrmAddressByUDescrIdxKey) {
      CFCrmAddressByUDescrIdxKey rhs = (CFCrmAddressByUDescrIdxKey) obj;

      if (getRequiredTenantId() < rhs.getRequiredTenantId()) {
        return (-1);
      } else if (getRequiredTenantId() > rhs.getRequiredTenantId()) {
        return (1);
      }
      if (getRequiredContactId() < rhs.getRequiredContactId()) {
        return (-1);
      } else if (getRequiredContactId() > rhs.getRequiredContactId()) {
        return (1);
      }
      {
        int cmp = getRequiredDescription().compareTo(rhs.getRequiredDescription());
        if (cmp != 0) {
          return (cmp);
        }
      }
      return (0);
    } else if (obj instanceof CFCrmAddressByCountryIdxKey) {
      CFCrmAddressByCountryIdxKey rhs = (CFCrmAddressByCountryIdxKey) obj;

      if (getOptionalCountryId() != null) {
        Short lhsCountryId = getOptionalCountryId();
        if (rhs.getOptionalCountryId() != null) {
          Short rhsCountryId = rhs.getOptionalCountryId();
          int cmp = lhsCountryId.compareTo(rhsCountryId);
          if (cmp != 0) {
            return (cmp);
          }
        } else {
          return (1);
        }
      } else {
        if (rhs.getOptionalCountryId() != null) {
          return (-1);
        }
      }
      return (0);
    } else if (obj instanceof CFCrmAddressHBuff) {
      CFCrmAddressHBuff rhs = (CFCrmAddressHBuff) obj;

      int retval = 0;
      {
        long lhsAuditClusterId = getAuditClusterId();
        long rhsAuditClusterId = rhs.getAuditClusterId();
        if (lhsAuditClusterId < rhsAuditClusterId) {
          return (-1);
        } else if (lhsAuditClusterId > rhsAuditClusterId) {
          return (1);
        }
      }
      {
        Calendar lhsAuditStamp = getAuditStamp();
        Calendar rhsAuditStamp = rhs.getAuditStamp();
        if (lhsAuditStamp == null) {
          if (rhsAuditStamp != null) {
            return (-1);
          }
        } else if (rhsAuditStamp == null) {
          return (1);
        } else {
          int cmpstat = lhsAuditStamp.compareTo(rhsAuditStamp);
          if (cmpstat != 0) {
            return (cmpstat);
          }
        }
      }
      {
        short lhsAuditActionId = getAuditActionId();
        short rhsAuditActionId = rhs.getAuditActionId();
        if (lhsAuditActionId < rhsAuditActionId) {
          return (-1);
        } else if (lhsAuditActionId > rhsAuditActionId) {
          return (1);
        }
      }
      {
        int lhsRequiredRevision = getRequiredRevision();
        int rhsRequiredRevision = rhs.getRequiredRevision();
        if (lhsRequiredRevision < rhsRequiredRevision) {
          return (-1);
        } else if (lhsRequiredRevision > rhsRequiredRevision) {
          return (1);
        }
      }
      {
        UUID lhsAuditSessionId = getAuditSessionId();
        UUID rhsAuditSessionId = rhs.getAuditSessionId();
        if (lhsAuditSessionId == null) {
          if (rhsAuditSessionId != null) {
            return (-1);
          }
        } else if (rhsAuditSessionId == null) {
          return (1);
        } else {
          int cmpstat = lhsAuditSessionId.compareTo(rhsAuditSessionId);
          if (cmpstat != 0) {
            return (cmpstat);
          }
        }
      }
      {
        long lhsAuditClusterId = getAuditClusterId();
        long rhsAuditClusterId = rhs.getAuditClusterId();
        if (lhsAuditClusterId < rhsAuditClusterId) {
          return (-1);
        } else if (lhsAuditClusterId > rhsAuditClusterId) {
          return (1);
        }
      }
      {
        Calendar lhsAuditStamp = getAuditStamp();
        Calendar rhsAuditStamp = rhs.getAuditStamp();
        if (lhsAuditStamp == null) {
          if (rhsAuditStamp != null) {
            return (-1);
          }
        } else if (rhsAuditStamp == null) {
          return (1);
        } else {
          int cmpstat = lhsAuditStamp.compareTo(rhsAuditStamp);
          if (cmpstat != 0) {
            return (cmpstat);
          }
        }
      }
      {
        short lhsAuditActionId = getAuditActionId();
        short rhsAuditActionId = rhs.getAuditActionId();
        if (lhsAuditActionId < rhsAuditActionId) {
          return (-1);
        } else if (lhsAuditActionId > rhsAuditActionId) {
          return (1);
        }
      }
      {
        int lhsRequiredRevision = getRequiredRevision();
        int rhsRequiredRevision = rhs.getRequiredRevision();
        if (lhsRequiredRevision < rhsRequiredRevision) {
          return (-1);
        } else if (lhsRequiredRevision > rhsRequiredRevision) {
          return (1);
        }
      }
      {
        UUID lhsAuditSessionId = getAuditSessionId();
        UUID rhsAuditSessionId = rhs.getAuditSessionId();
        if (lhsAuditSessionId == null) {
          if (rhsAuditSessionId != null) {
            return (-1);
          }
        } else if (rhsAuditSessionId == null) {
          return (1);
        } else {
          int cmpstat = lhsAuditSessionId.compareTo(rhsAuditSessionId);
          if (cmpstat != 0) {
            return (cmpstat);
          }
        }
      }
      if (getRequiredTenantId() < rhs.getRequiredTenantId()) {
        return (-1);
      } else if (getRequiredTenantId() > rhs.getRequiredTenantId()) {
        return (1);
      }
      if (getRequiredAddressId() < rhs.getRequiredAddressId()) {
        return (-1);
      } else if (getRequiredAddressId() > rhs.getRequiredAddressId()) {
        return (1);
      }
      if (getRequiredContactId() < rhs.getRequiredContactId()) {
        return (-1);
      } else if (getRequiredContactId() > rhs.getRequiredContactId()) {
        return (1);
      }
      {
        int cmp = getRequiredDescription().compareTo(rhs.getRequiredDescription());
        if (cmp != 0) {
          return (cmp);
        }
      }
      if (getOptionalAddrLine1() != null) {
        if (rhs.getOptionalAddrLine1() != null) {
          int cmp = getOptionalAddrLine1().compareTo(rhs.getOptionalAddrLine1());
          if (cmp != 0) {
            return (cmp);
          }
        } else {
          return (1);
        }
      } else {
        if (rhs.getOptionalAddrLine1() != null) {
          return (-1);
        }
      }
      if (getOptionalAddrLine2() != null) {
        if (rhs.getOptionalAddrLine2() != null) {
          int cmp = getOptionalAddrLine2().compareTo(rhs.getOptionalAddrLine2());
          if (cmp != 0) {
            return (cmp);
          }
        } else {
          return (1);
        }
      } else {
        if (rhs.getOptionalAddrLine2() != null) {
          return (-1);
        }
      }
      if (getOptionalCity() != null) {
        if (rhs.getOptionalCity() != null) {
          int cmp = getOptionalCity().compareTo(rhs.getOptionalCity());
          if (cmp != 0) {
            return (cmp);
          }
        } else {
          return (1);
        }
      } else {
        if (rhs.getOptionalCity() != null) {
          return (-1);
        }
      }
      if (getOptionalState() != null) {
        if (rhs.getOptionalState() != null) {
          int cmp = getOptionalState().compareTo(rhs.getOptionalState());
          if (cmp != 0) {
            return (cmp);
          }
        } else {
          return (1);
        }
      } else {
        if (rhs.getOptionalState() != null) {
          return (-1);
        }
      }
      if (getOptionalCountryId() != null) {
        Short lhsCountryId = getOptionalCountryId();
        if (rhs.getOptionalCountryId() != null) {
          Short rhsCountryId = rhs.getOptionalCountryId();
          int cmp = lhsCountryId.compareTo(rhsCountryId);
          if (cmp != 0) {
            return (cmp);
          }
        } else {
          return (1);
        }
      } else {
        if (rhs.getOptionalCountryId() != null) {
          return (-1);
        }
      }
      if (getOptionalZip() != null) {
        if (rhs.getOptionalZip() != null) {
          int cmp = getOptionalZip().compareTo(rhs.getOptionalZip());
          if (cmp != 0) {
            return (cmp);
          }
        } else {
          return (1);
        }
      } else {
        if (rhs.getOptionalZip() != null) {
          return (-1);
        }
      }
      return (0);
    } else if (obj instanceof CFCrmAddressHPKey) {
      CFCrmAddressHPKey rhs = (CFCrmAddressHPKey) obj;
      {
        long lhsAuditClusterId = getAuditClusterId();
        long rhsAuditClusterId = rhs.getAuditClusterId();
        if (lhsAuditClusterId < rhsAuditClusterId) {
          return (-1);
        } else if (lhsAuditClusterId > rhsAuditClusterId) {
          return (1);
        }
      }
      {
        Calendar lhsAuditStamp = getAuditStamp();
        Calendar rhsAuditStamp = rhs.getAuditStamp();
        if (lhsAuditStamp == null) {
          if (rhsAuditStamp != null) {
            return (-1);
          }
        } else if (rhsAuditStamp == null) {
          return (1);
        } else {
          int cmpstat = lhsAuditStamp.compareTo(rhsAuditStamp);
          if (cmpstat != 0) {
            return (cmpstat);
          }
        }
      }
      {
        short lhsAuditActionId = getAuditActionId();
        short rhsAuditActionId = rhs.getAuditActionId();
        if (lhsAuditActionId < rhsAuditActionId) {
          return (-1);
        } else if (lhsAuditActionId > rhsAuditActionId) {
          return (1);
        }
      }
      {
        int lhsRequiredRevision = getRequiredRevision();
        int rhsRequiredRevision = rhs.getRequiredRevision();
        if (lhsRequiredRevision < rhsRequiredRevision) {
          return (-1);
        } else if (lhsRequiredRevision > rhsRequiredRevision) {
          return (1);
        }
      }
      {
        UUID lhsAuditSessionId = getAuditSessionId();
        UUID rhsAuditSessionId = rhs.getAuditSessionId();
        if (lhsAuditSessionId == null) {
          if (rhsAuditSessionId != null) {
            return (-1);
          }
        } else if (rhsAuditSessionId == null) {
          return (1);
        } else {
          int cmpstat = lhsAuditSessionId.compareTo(rhsAuditSessionId);
          if (cmpstat != 0) {
            return (cmpstat);
          }
        }
      }
      if (getRequiredTenantId() < rhs.getRequiredTenantId()) {
        return (-1);
      } else if (getRequiredTenantId() > rhs.getRequiredTenantId()) {
        return (1);
      }
      if (getRequiredAddressId() < rhs.getRequiredAddressId()) {
        return (-1);
      } else if (getRequiredAddressId() > rhs.getRequiredAddressId()) {
        return (1);
      }
      return (0);
    } else if (obj instanceof CFCrmAddressPKey) {
      CFCrmAddressPKey rhs = (CFCrmAddressPKey) obj;
      if (getRequiredTenantId() < rhs.getRequiredTenantId()) {
        return (-1);
      } else if (getRequiredTenantId() > rhs.getRequiredTenantId()) {
        return (1);
      }
      if (getRequiredAddressId() < rhs.getRequiredAddressId()) {
        return (-1);
      } else if (getRequiredAddressId() > rhs.getRequiredAddressId()) {
        return (1);
      }
      return (0);
    } else if (obj instanceof CFCrmHPKey) {
      CFCrmHPKey rhs = (CFCrmHPKey) obj;
      {
        int lhsRequiredRevision = getRequiredRevision();
        int rhsRequiredRevision = rhs.getRequiredRevision();
        if (lhsRequiredRevision < rhsRequiredRevision) {
          return (-1);
        } else if (lhsRequiredRevision > rhsRequiredRevision) {
          return (1);
        }
      }
      return (0);
    } else {
      return (super.compareTo(obj));
    }
  }
  public int compareTo(Object obj) {
    if (obj == null) {
      return (-1);
    } else if (obj instanceof CFBamClearSubDep2Buff) {
      CFBamClearSubDep2Buff rhs = (CFBamClearSubDep2Buff) obj;
      int retval = super.compareTo(rhs);
      if (retval != 0) {
        return (retval);
      }
      return (0);
    } else if (obj instanceof CFBamClearSubDep2ByContClearDep1IdxKey) {
      CFBamClearSubDep2ByContClearDep1IdxKey rhs = (CFBamClearSubDep2ByContClearDep1IdxKey) obj;

      if (getRequiredContClearDep1TenantId() < rhs.getRequiredContClearDep1TenantId()) {
        return (-1);
      } else if (getRequiredContClearDep1TenantId() > rhs.getRequiredContClearDep1TenantId()) {
        return (1);
      }
      if (getRequiredContClearDep1Id() < rhs.getRequiredContClearDep1Id()) {
        return (-1);
      } else if (getRequiredContClearDep1Id() > rhs.getRequiredContClearDep1Id()) {
        return (1);
      }
      return (0);
    } else if (obj instanceof CFBamClearSubDep2ByUNameIdxKey) {
      CFBamClearSubDep2ByUNameIdxKey rhs = (CFBamClearSubDep2ByUNameIdxKey) obj;

      if (getRequiredTenantId() < rhs.getRequiredTenantId()) {
        return (-1);
      } else if (getRequiredTenantId() > rhs.getRequiredTenantId()) {
        return (1);
      }
      if (getRequiredContClearDep1Id() < rhs.getRequiredContClearDep1Id()) {
        return (-1);
      } else if (getRequiredContClearDep1Id() > rhs.getRequiredContClearDep1Id()) {
        return (1);
      }
      {
        int cmp = getRequiredName().compareTo(rhs.getRequiredName());
        if (cmp != 0) {
          return (cmp);
        }
      }
      return (0);
    } else if (obj instanceof CFBamClearSubDep2HBuff) {
      CFBamClearSubDep2HBuff rhs = (CFBamClearSubDep2HBuff) obj;

      int retval = super.compareTo(rhs);
      if (retval != 0) {
        return (retval);
      }
      {
        long lhsAuditClusterId = getAuditClusterId();
        long rhsAuditClusterId = rhs.getAuditClusterId();
        if (lhsAuditClusterId < rhsAuditClusterId) {
          return (-1);
        } else if (lhsAuditClusterId > rhsAuditClusterId) {
          return (1);
        }
      }
      {
        Calendar lhsAuditStamp = getAuditStamp();
        Calendar rhsAuditStamp = rhs.getAuditStamp();
        if (lhsAuditStamp == null) {
          if (rhsAuditStamp != null) {
            return (-1);
          }
        } else if (rhsAuditStamp == null) {
          return (1);
        } else {
          int cmpstat = lhsAuditStamp.compareTo(rhsAuditStamp);
          if (cmpstat != 0) {
            return (cmpstat);
          }
        }
      }
      {
        short lhsAuditActionId = getAuditActionId();
        short rhsAuditActionId = rhs.getAuditActionId();
        if (lhsAuditActionId < rhsAuditActionId) {
          return (-1);
        } else if (lhsAuditActionId > rhsAuditActionId) {
          return (1);
        }
      }
      {
        int lhsRequiredRevision = getRequiredRevision();
        int rhsRequiredRevision = rhs.getRequiredRevision();
        if (lhsRequiredRevision < rhsRequiredRevision) {
          return (-1);
        } else if (lhsRequiredRevision > rhsRequiredRevision) {
          return (1);
        }
      }
      {
        UUID lhsAuditSessionId = getAuditSessionId();
        UUID rhsAuditSessionId = rhs.getAuditSessionId();
        if (lhsAuditSessionId == null) {
          if (rhsAuditSessionId != null) {
            return (-1);
          }
        } else if (rhsAuditSessionId == null) {
          return (1);
        } else {
          int cmpstat = lhsAuditSessionId.compareTo(rhsAuditSessionId);
          if (cmpstat != 0) {
            return (cmpstat);
          }
        }
      }
      if (getRequiredTenantId() < rhs.getRequiredTenantId()) {
        return (-1);
      } else if (getRequiredTenantId() > rhs.getRequiredTenantId()) {
        return (1);
      }
      if (getRequiredId() < rhs.getRequiredId()) {
        return (-1);
      } else if (getRequiredId() > rhs.getRequiredId()) {
        return (1);
      }
      if (getRequiredRelationId() < rhs.getRequiredRelationId()) {
        return (-1);
      } else if (getRequiredRelationId() > rhs.getRequiredRelationId()) {
        return (1);
      }
      if (getRequiredContClearDep1TenantId() < rhs.getRequiredContClearDep1TenantId()) {
        return (-1);
      } else if (getRequiredContClearDep1TenantId() > rhs.getRequiredContClearDep1TenantId()) {
        return (1);
      }
      if (getRequiredContClearDep1Id() < rhs.getRequiredContClearDep1Id()) {
        return (-1);
      } else if (getRequiredContClearDep1Id() > rhs.getRequiredContClearDep1Id()) {
        return (1);
      }
      {
        int cmp = getRequiredName().compareTo(rhs.getRequiredName());
        if (cmp != 0) {
          return (cmp);
        }
      }
      return (0);
    } else {
      return (super.compareTo(obj));
    }
  }
 public boolean equals(Object obj) {
   if (obj == null) {
     return (false);
   } else if (obj instanceof CFCrmAddressHBuff) {
     CFCrmAddressHBuff rhs = (CFCrmAddressHBuff) obj;
     if (!super.equals(obj)) {
       return (false);
     }
     if (getRequiredTenantId() != rhs.getRequiredTenantId()) {
       return (false);
     }
     if (getRequiredAddressId() != rhs.getRequiredAddressId()) {
       return (false);
     }
     if (getRequiredContactId() != rhs.getRequiredContactId()) {
       return (false);
     }
     if (!getRequiredDescription().equals(rhs.getRequiredDescription())) {
       return (false);
     }
     if (getOptionalAddrLine1() != null) {
       if (rhs.getOptionalAddrLine1() != null) {
         if (!getOptionalAddrLine1().equals(rhs.getOptionalAddrLine1())) {
           return (false);
         }
       }
     } else {
       if (rhs.getOptionalAddrLine1() != null) {
         return (false);
       }
     }
     if (getOptionalAddrLine2() != null) {
       if (rhs.getOptionalAddrLine2() != null) {
         if (!getOptionalAddrLine2().equals(rhs.getOptionalAddrLine2())) {
           return (false);
         }
       }
     } else {
       if (rhs.getOptionalAddrLine2() != null) {
         return (false);
       }
     }
     if (getOptionalCity() != null) {
       if (rhs.getOptionalCity() != null) {
         if (!getOptionalCity().equals(rhs.getOptionalCity())) {
           return (false);
         }
       }
     } else {
       if (rhs.getOptionalCity() != null) {
         return (false);
       }
     }
     if (getOptionalState() != null) {
       if (rhs.getOptionalState() != null) {
         if (!getOptionalState().equals(rhs.getOptionalState())) {
           return (false);
         }
       }
     } else {
       if (rhs.getOptionalState() != null) {
         return (false);
       }
     }
     if (getOptionalCountryId() != null) {
       if (rhs.getOptionalCountryId() != null) {
         if (!getOptionalCountryId().equals(rhs.getOptionalCountryId())) {
           return (false);
         }
       }
     } else {
       if (rhs.getOptionalCountryId() != null) {
         return (false);
       }
     }
     if (getOptionalZip() != null) {
       if (rhs.getOptionalZip() != null) {
         if (!getOptionalZip().equals(rhs.getOptionalZip())) {
           return (false);
         }
       }
     } else {
       if (rhs.getOptionalZip() != null) {
         return (false);
       }
     }
     return (true);
   } else if (obj instanceof CFCrmAddressBuff) {
     CFCrmAddressBuff rhs = (CFCrmAddressBuff) obj;
     if (!super.equals(obj)) {
       return (false);
     }
     if (getRequiredTenantId() != rhs.getRequiredTenantId()) {
       return (false);
     }
     if (getRequiredAddressId() != rhs.getRequiredAddressId()) {
       return (false);
     }
     if (getRequiredContactId() != rhs.getRequiredContactId()) {
       return (false);
     }
     if (!getRequiredDescription().equals(rhs.getRequiredDescription())) {
       return (false);
     }
     if (getOptionalAddrLine1() != null) {
       if (rhs.getOptionalAddrLine1() != null) {
         if (!getOptionalAddrLine1().equals(rhs.getOptionalAddrLine1())) {
           return (false);
         }
       }
     } else {
       if (rhs.getOptionalAddrLine1() != null) {
         return (false);
       }
     }
     if (getOptionalAddrLine2() != null) {
       if (rhs.getOptionalAddrLine2() != null) {
         if (!getOptionalAddrLine2().equals(rhs.getOptionalAddrLine2())) {
           return (false);
         }
       }
     } else {
       if (rhs.getOptionalAddrLine2() != null) {
         return (false);
       }
     }
     if (getOptionalCity() != null) {
       if (rhs.getOptionalCity() != null) {
         if (!getOptionalCity().equals(rhs.getOptionalCity())) {
           return (false);
         }
       }
     } else {
       if (rhs.getOptionalCity() != null) {
         return (false);
       }
     }
     if (getOptionalState() != null) {
       if (rhs.getOptionalState() != null) {
         if (!getOptionalState().equals(rhs.getOptionalState())) {
           return (false);
         }
       }
     } else {
       if (rhs.getOptionalState() != null) {
         return (false);
       }
     }
     if (getOptionalCountryId() != null) {
       if (rhs.getOptionalCountryId() != null) {
         if (!getOptionalCountryId().equals(rhs.getOptionalCountryId())) {
           return (false);
         }
       }
     } else {
       if (rhs.getOptionalCountryId() != null) {
         return (false);
       }
     }
     if (getOptionalZip() != null) {
       if (rhs.getOptionalZip() != null) {
         if (!getOptionalZip().equals(rhs.getOptionalZip())) {
           return (false);
         }
       }
     } else {
       if (rhs.getOptionalZip() != null) {
         return (false);
       }
     }
     return (true);
   } else if (obj instanceof CFCrmAddressByTenantIdxKey) {
     CFCrmAddressByTenantIdxKey rhs = (CFCrmAddressByTenantIdxKey) obj;
     if (getRequiredTenantId() != rhs.getRequiredTenantId()) {
       return (false);
     }
     return (true);
   } else if (obj instanceof CFCrmAddressByContactIdxKey) {
     CFCrmAddressByContactIdxKey rhs = (CFCrmAddressByContactIdxKey) obj;
     if (getRequiredTenantId() != rhs.getRequiredTenantId()) {
       return (false);
     }
     if (getRequiredContactId() != rhs.getRequiredContactId()) {
       return (false);
     }
     return (true);
   } else if (obj instanceof CFCrmAddressByUDescrIdxKey) {
     CFCrmAddressByUDescrIdxKey rhs = (CFCrmAddressByUDescrIdxKey) obj;
     if (getRequiredTenantId() != rhs.getRequiredTenantId()) {
       return (false);
     }
     if (getRequiredContactId() != rhs.getRequiredContactId()) {
       return (false);
     }
     if (!getRequiredDescription().equals(rhs.getRequiredDescription())) {
       return (false);
     }
     return (true);
   } else if (obj instanceof CFCrmAddressByCountryIdxKey) {
     CFCrmAddressByCountryIdxKey rhs = (CFCrmAddressByCountryIdxKey) obj;
     if (getOptionalCountryId() != null) {
       if (rhs.getOptionalCountryId() != null) {
         if (!getOptionalCountryId().equals(rhs.getOptionalCountryId())) {
           return (false);
         }
       }
     } else {
       if (rhs.getOptionalCountryId() != null) {
         return (false);
       }
     }
     return (true);
   } else if (obj instanceof CFCrmAddressHPKey) {
     CFCrmAddressHPKey rhs = (CFCrmAddressHPKey) obj;
     {
       long lhsClusterId = getAuditClusterId();
       long rhsClusterId = rhs.getAuditClusterId();
       if (lhsClusterId != rhsClusterId) {
         return (false);
       }
     }
     {
       Calendar lhsAuditStamp = getAuditStamp();
       Calendar rhsAuditStamp = rhs.getAuditStamp();
       if (lhsAuditStamp != null) {
         if (rhsAuditStamp != null) {
           if (!lhsAuditStamp.equals(rhsAuditStamp)) {
             return (false);
           }
         } else {
           return (false);
         }
       } else {
         return (false);
       }
     }
     {
       short lhsActionId = getAuditActionId();
       short rhsActionId = rhs.getAuditActionId();
       if (lhsActionId != rhsActionId) {
         return (false);
       }
     }
     {
       int lhsRevision = getRequiredRevision();
       int rhsRevision = rhs.getRequiredRevision();
       if (lhsRevision != rhsRevision) {
         return (false);
       }
     }
     {
       UUID lhsAuditSessionId = getAuditSessionId();
       UUID rhsAuditSessionId = rhs.getAuditSessionId();
       if (lhsAuditSessionId != null) {
         if (rhsAuditSessionId != null) {
           if (!lhsAuditSessionId.equals(rhsAuditSessionId)) {
             return (false);
           }
         } else {
           return (false);
         }
       } else {
         return (false);
       }
     }
     if (getRequiredTenantId() != rhs.getRequiredTenantId()) {
       return (false);
     }
     if (getRequiredAddressId() != rhs.getRequiredAddressId()) {
       return (false);
     }
     return (true);
   } else if (obj instanceof CFCrmHPKey) {
     CFCrmHPKey rhs = (CFCrmHPKey) obj;
     {
       long lhsClusterId = getAuditClusterId();
       long rhsClusterId = rhs.getAuditClusterId();
       if (lhsClusterId != rhsClusterId) {
         return (false);
       }
     }
     {
       Calendar lhsAuditStamp = getAuditStamp();
       Calendar rhsAuditStamp = rhs.getAuditStamp();
       if (lhsAuditStamp != null) {
         if (rhsAuditStamp != null) {
           if (!lhsAuditStamp.equals(rhsAuditStamp)) {
             return (false);
           }
         } else {
           return (false);
         }
       } else {
         return (false);
       }
     }
     {
       short lhsActionId = getAuditActionId();
       short rhsActionId = rhs.getAuditActionId();
       if (lhsActionId != rhsActionId) {
         return (false);
       }
     }
     {
       int lhsRevision = getRequiredRevision();
       int rhsRevision = rhs.getRequiredRevision();
       if (lhsRevision != rhsRevision) {
         return (false);
       }
     }
     {
       UUID lhsAuditSessionId = getAuditSessionId();
       UUID rhsAuditSessionId = rhs.getAuditSessionId();
       if (lhsAuditSessionId != null) {
         if (rhsAuditSessionId != null) {
           if (!lhsAuditSessionId.equals(rhsAuditSessionId)) {
             return (false);
           }
         } else {
           return (false);
         }
       } else {
         return (false);
       }
     }
     return (true);
   } else if (obj instanceof CFCrmAddressPKey) {
     CFCrmAddressPKey rhs = (CFCrmAddressPKey) obj;
     if (getRequiredTenantId() != rhs.getRequiredTenantId()) {
       return (false);
     }
     if (getRequiredAddressId() != rhs.getRequiredAddressId()) {
       return (false);
     }
     return (true);
   } else {
     return (super.equals(obj));
   }
 }
  public int compareTo(Object obj) {
    if (obj == null) {
      return (-1);
    } else if (obj instanceof CFBamBlobColBuff) {
      CFBamBlobColBuff rhs = (CFBamBlobColBuff) obj;
      int retval = super.compareTo(rhs);
      if (retval != 0) {
        return (retval);
      }
      return (0);
    } else if (obj instanceof CFBamBlobColByTableIdxKey) {
      CFBamBlobColByTableIdxKey rhs = (CFBamBlobColByTableIdxKey) obj;

      if (getRequiredTenantId() < rhs.getRequiredTenantId()) {
        return (-1);
      } else if (getRequiredTenantId() > rhs.getRequiredTenantId()) {
        return (1);
      }
      if (getRequiredTableId() < rhs.getRequiredTableId()) {
        return (-1);
      } else if (getRequiredTableId() > rhs.getRequiredTableId()) {
        return (1);
      }
      return (0);
    } else if (obj instanceof CFBamBlobColHBuff) {
      CFBamBlobColHBuff rhs = (CFBamBlobColHBuff) obj;

      int retval = super.compareTo(rhs);
      if (retval != 0) {
        return (retval);
      }
      {
        long lhsAuditClusterId = getAuditClusterId();
        long rhsAuditClusterId = rhs.getAuditClusterId();
        if (lhsAuditClusterId < rhsAuditClusterId) {
          return (-1);
        } else if (lhsAuditClusterId > rhsAuditClusterId) {
          return (1);
        }
      }
      {
        Calendar lhsAuditStamp = getAuditStamp();
        Calendar rhsAuditStamp = rhs.getAuditStamp();
        if (lhsAuditStamp == null) {
          if (rhsAuditStamp != null) {
            return (-1);
          }
        } else if (rhsAuditStamp == null) {
          return (1);
        } else {
          int cmpstat = lhsAuditStamp.compareTo(rhsAuditStamp);
          if (cmpstat != 0) {
            return (cmpstat);
          }
        }
      }
      {
        short lhsAuditActionId = getAuditActionId();
        short rhsAuditActionId = rhs.getAuditActionId();
        if (lhsAuditActionId < rhsAuditActionId) {
          return (-1);
        } else if (lhsAuditActionId > rhsAuditActionId) {
          return (1);
        }
      }
      {
        int lhsRequiredRevision = getRequiredRevision();
        int rhsRequiredRevision = rhs.getRequiredRevision();
        if (lhsRequiredRevision < rhsRequiredRevision) {
          return (-1);
        } else if (lhsRequiredRevision > rhsRequiredRevision) {
          return (1);
        }
      }
      {
        UUID lhsAuditSessionId = getAuditSessionId();
        UUID rhsAuditSessionId = rhs.getAuditSessionId();
        if (lhsAuditSessionId == null) {
          if (rhsAuditSessionId != null) {
            return (-1);
          }
        } else if (rhsAuditSessionId == null) {
          return (1);
        } else {
          int cmpstat = lhsAuditSessionId.compareTo(rhsAuditSessionId);
          if (cmpstat != 0) {
            return (cmpstat);
          }
        }
      }
      if (getRequiredTenantId() < rhs.getRequiredTenantId()) {
        return (-1);
      } else if (getRequiredTenantId() > rhs.getRequiredTenantId()) {
        return (1);
      }
      if (getRequiredScopeId() < rhs.getRequiredScopeId()) {
        return (-1);
      } else if (getRequiredScopeId() > rhs.getRequiredScopeId()) {
        return (1);
      }
      if (getRequiredId() < rhs.getRequiredId()) {
        return (-1);
      } else if (getRequiredId() > rhs.getRequiredId()) {
        return (1);
      }
      if (getOptionalDefSchemaTenantId() != null) {
        Long lhsDefSchemaTenantId = getOptionalDefSchemaTenantId();
        if (rhs.getOptionalDefSchemaTenantId() != null) {
          Long rhsDefSchemaTenantId = rhs.getOptionalDefSchemaTenantId();
          int cmp = lhsDefSchemaTenantId.compareTo(rhsDefSchemaTenantId);
          if (cmp != 0) {
            return (cmp);
          }
        } else {
          return (1);
        }
      } else {
        if (rhs.getOptionalDefSchemaTenantId() != null) {
          return (-1);
        }
      }
      if (getOptionalDefSchemaId() != null) {
        Long lhsDefSchemaId = getOptionalDefSchemaId();
        if (rhs.getOptionalDefSchemaId() != null) {
          Long rhsDefSchemaId = rhs.getOptionalDefSchemaId();
          int cmp = lhsDefSchemaId.compareTo(rhsDefSchemaId);
          if (cmp != 0) {
            return (cmp);
          }
        } else {
          return (1);
        }
      } else {
        if (rhs.getOptionalDefSchemaId() != null) {
          return (-1);
        }
      }
      {
        int cmp = getRequiredName().compareTo(rhs.getRequiredName());
        if (cmp != 0) {
          return (cmp);
        }
      }
      if (getOptionalShortName() != null) {
        if (rhs.getOptionalShortName() != null) {
          int cmp = getOptionalShortName().compareTo(rhs.getOptionalShortName());
          if (cmp != 0) {
            return (cmp);
          }
        } else {
          return (1);
        }
      } else {
        if (rhs.getOptionalShortName() != null) {
          return (-1);
        }
      }
      if (getOptionalLabel() != null) {
        if (rhs.getOptionalLabel() != null) {
          int cmp = getOptionalLabel().compareTo(rhs.getOptionalLabel());
          if (cmp != 0) {
            return (cmp);
          }
        } else {
          return (1);
        }
      } else {
        if (rhs.getOptionalLabel() != null) {
          return (-1);
        }
      }
      if (getOptionalShortDescription() != null) {
        if (rhs.getOptionalShortDescription() != null) {
          int cmp = getOptionalShortDescription().compareTo(rhs.getOptionalShortDescription());
          if (cmp != 0) {
            return (cmp);
          }
        } else {
          return (1);
        }
      } else {
        if (rhs.getOptionalShortDescription() != null) {
          return (-1);
        }
      }
      if (getOptionalDescription() != null) {
        if (rhs.getOptionalDescription() != null) {
          int cmp = getOptionalDescription().compareTo(rhs.getOptionalDescription());
          if (cmp != 0) {
            return (cmp);
          }
        } else {
          return (1);
        }
      } else {
        if (rhs.getOptionalDescription() != null) {
          return (-1);
        }
      }
      if (getRequiredIsNullable()) {
        if (!rhs.getRequiredIsNullable()) {
          return (1);
        }
      } else {
        if (rhs.getRequiredIsNullable()) {
          return (-1);
        }
      }
      if (getOptionalGenerateId() != null) {
        Boolean lhsGenerateId = getOptionalGenerateId();
        if (rhs.getOptionalGenerateId()) {
          Boolean rhsGenerateId = rhs.getOptionalGenerateId();
          if (lhsGenerateId) {
            if (!rhsGenerateId) {
              return (1);
            }
          } else {
            if (rhsGenerateId) {
              return (-1);
            }
          }
        } else {
          return (1);
        }
      } else {
        if (rhs.getOptionalGenerateId() != null) {
          return (-1);
        }
      }
      if (getOptionalDataScope() != null) {
        if (rhs.getOptionalDataScope() != null) {
          int cmp = getOptionalDataScope().compareTo(rhs.getOptionalDataScope());
          if (cmp != 0) {
            return (cmp);
          }
        } else {
          return (1);
        }
      } else {
        if (rhs.getOptionalDataScope() != null) {
          return (-1);
        }
      }
      if (getOptionalViewAccessSecurity() != null) {
        if (rhs.getOptionalViewAccessSecurity() != null) {
          int cmp = getOptionalViewAccessSecurity().compareTo(rhs.getOptionalViewAccessSecurity());
          if (cmp != 0) {
            return (cmp);
          }
        } else {
          return (1);
        }
      } else {
        if (rhs.getOptionalViewAccessSecurity() != null) {
          return (-1);
        }
      }
      if (getOptionalEditAccessSecurity() != null) {
        if (rhs.getOptionalEditAccessSecurity() != null) {
          int cmp = getOptionalEditAccessSecurity().compareTo(rhs.getOptionalEditAccessSecurity());
          if (cmp != 0) {
            return (cmp);
          }
        } else {
          return (1);
        }
      } else {
        if (rhs.getOptionalEditAccessSecurity() != null) {
          return (-1);
        }
      }
      if (getOptionalViewAccessFrequency() != null) {
        if (rhs.getOptionalViewAccessFrequency() != null) {
          int cmp =
              getOptionalViewAccessFrequency().compareTo(rhs.getOptionalViewAccessFrequency());
          if (cmp != 0) {
            return (cmp);
          }
        } else {
          return (1);
        }
      } else {
        if (rhs.getOptionalViewAccessFrequency() != null) {
          return (-1);
        }
      }
      if (getOptionalEditAccessFrequency() != null) {
        if (rhs.getOptionalEditAccessFrequency() != null) {
          int cmp =
              getOptionalEditAccessFrequency().compareTo(rhs.getOptionalEditAccessFrequency());
          if (cmp != 0) {
            return (cmp);
          }
        } else {
          return (1);
        }
      } else {
        if (rhs.getOptionalEditAccessFrequency() != null) {
          return (-1);
        }
      }
      if (getOptionalPrevTenantId() != null) {
        Long lhsPrevTenantId = getOptionalPrevTenantId();
        if (rhs.getOptionalPrevTenantId() != null) {
          Long rhsPrevTenantId = rhs.getOptionalPrevTenantId();
          int cmp = lhsPrevTenantId.compareTo(rhsPrevTenantId);
          if (cmp != 0) {
            return (cmp);
          }
        } else {
          return (1);
        }
      } else {
        if (rhs.getOptionalPrevTenantId() != null) {
          return (-1);
        }
      }
      if (getOptionalPrevId() != null) {
        Long lhsPrevId = getOptionalPrevId();
        if (rhs.getOptionalPrevId() != null) {
          Long rhsPrevId = rhs.getOptionalPrevId();
          int cmp = lhsPrevId.compareTo(rhsPrevId);
          if (cmp != 0) {
            return (cmp);
          }
        } else {
          return (1);
        }
      } else {
        if (rhs.getOptionalPrevId() != null) {
          return (-1);
        }
      }
      if (getOptionalNextTenantId() != null) {
        Long lhsNextTenantId = getOptionalNextTenantId();
        if (rhs.getOptionalNextTenantId() != null) {
          Long rhsNextTenantId = rhs.getOptionalNextTenantId();
          int cmp = lhsNextTenantId.compareTo(rhsNextTenantId);
          if (cmp != 0) {
            return (cmp);
          }
        } else {
          return (1);
        }
      } else {
        if (rhs.getOptionalNextTenantId() != null) {
          return (-1);
        }
      }
      if (getOptionalNextId() != null) {
        Long lhsNextId = getOptionalNextId();
        if (rhs.getOptionalNextId() != null) {
          Long rhsNextId = rhs.getOptionalNextId();
          int cmp = lhsNextId.compareTo(rhsNextId);
          if (cmp != 0) {
            return (cmp);
          }
        } else {
          return (1);
        }
      } else {
        if (rhs.getOptionalNextId() != null) {
          return (-1);
        }
      }
      if (getRequiredDefaultVisibility()) {
        if (!rhs.getRequiredDefaultVisibility()) {
          return (1);
        }
      } else {
        if (rhs.getRequiredDefaultVisibility()) {
          return (-1);
        }
      }
      if (getOptionalDbName() != null) {
        if (rhs.getOptionalDbName() != null) {
          int cmp = getOptionalDbName().compareTo(rhs.getOptionalDbName());
          if (cmp != 0) {
            return (cmp);
          }
        } else {
          return (1);
        }
      } else {
        if (rhs.getOptionalDbName() != null) {
          return (-1);
        }
      }
      if (getRequiredMaxLen() < rhs.getRequiredMaxLen()) {
        return (-1);
      } else if (getRequiredMaxLen() > rhs.getRequiredMaxLen()) {
        return (1);
      }
      if (getOptionalInitValue() != null) {
        if (rhs.getOptionalInitValue() != null) {
          byte[] larr = getOptionalInitValue();
          byte[] rarr = rhs.getOptionalInitValue();
          int llen = larr.length;
          int rlen = rarr.length;
          int idx = 0;
          byte lval;
          byte rval;
          while ((idx < llen) && (idx < rlen)) {
            lval = larr[idx];
            rval = rarr[idx];
            if (lval < rval) {
              return (-1);
            } else if (lval > rval) {
              return (1);
            }
            idx++;
          }
          if (llen < rlen) {
            return (-1);
          } else if (llen > rlen) {
            return (1);
          }
        } else {
          return (1);
        }
      } else {
        if (rhs.getOptionalInitValue() != null) {
          return (-1);
        }
      }
      if (getOptionalDefaultValue() != null) {
        if (rhs.getOptionalDefaultValue() != null) {
          byte[] larr = getOptionalDefaultValue();
          byte[] rarr = rhs.getOptionalDefaultValue();
          int llen = larr.length;
          int rlen = rarr.length;
          int idx = 0;
          byte lval;
          byte rval;
          while ((idx < llen) && (idx < rlen)) {
            lval = larr[idx];
            rval = rarr[idx];
            if (lval < rval) {
              return (-1);
            } else if (lval > rval) {
              return (1);
            }
            idx++;
          }
          if (llen < rlen) {
            return (-1);
          } else if (llen > rlen) {
            return (1);
          }
        } else {
          return (1);
        }
      } else {
        if (rhs.getOptionalDefaultValue() != null) {
          return (-1);
        }
      }
      if (getOptionalNullValue() != null) {
        if (rhs.getOptionalNullValue() != null) {
          byte[] larr = getOptionalNullValue();
          byte[] rarr = rhs.getOptionalNullValue();
          int llen = larr.length;
          int rlen = rarr.length;
          int idx = 0;
          byte lval;
          byte rval;
          while ((idx < llen) && (idx < rlen)) {
            lval = larr[idx];
            rval = rarr[idx];
            if (lval < rval) {
              return (-1);
            } else if (lval > rval) {
              return (1);
            }
            idx++;
          }
          if (llen < rlen) {
            return (-1);
          } else if (llen > rlen) {
            return (1);
          }
        } else {
          return (1);
        }
      } else {
        if (rhs.getOptionalNullValue() != null) {
          return (-1);
        }
      }
      if (getOptionalUnknownValue() != null) {
        if (rhs.getOptionalUnknownValue() != null) {
          byte[] larr = getOptionalUnknownValue();
          byte[] rarr = rhs.getOptionalUnknownValue();
          int llen = larr.length;
          int rlen = rarr.length;
          int idx = 0;
          byte lval;
          byte rval;
          while ((idx < llen) && (idx < rlen)) {
            lval = larr[idx];
            rval = rarr[idx];
            if (lval < rval) {
              return (-1);
            } else if (lval > rval) {
              return (1);
            }
            idx++;
          }
          if (llen < rlen) {
            return (-1);
          } else if (llen > rlen) {
            return (1);
          }
        } else {
          return (1);
        }
      } else {
        if (rhs.getOptionalUnknownValue() != null) {
          return (-1);
        }
      }
      if (getRequiredTableId() < rhs.getRequiredTableId()) {
        return (-1);
      } else if (getRequiredTableId() > rhs.getRequiredTableId()) {
        return (1);
      }
      return (0);
    } else {
      return (super.compareTo(obj));
    }
  }