public boolean equals(Object obj) {
   if (obj == null) {
     return (false);
   } else if (obj instanceof CFBamIndexColByDefSchemaIdxKey) {
     CFBamIndexColByDefSchemaIdxKey rhs = (CFBamIndexColByDefSchemaIdxKey) obj;
     if (getOptionalDefSchemaTenantId() != null) {
       if (rhs.getOptionalDefSchemaTenantId() != null) {
         if (!getOptionalDefSchemaTenantId().equals(rhs.getOptionalDefSchemaTenantId())) {
           return (false);
         }
       }
     } else {
       if (rhs.getOptionalDefSchemaTenantId() != null) {
         return (false);
       }
     }
     if (getOptionalDefSchemaId() != null) {
       if (rhs.getOptionalDefSchemaId() != null) {
         if (!getOptionalDefSchemaId().equals(rhs.getOptionalDefSchemaId())) {
           return (false);
         }
       }
     } else {
       if (rhs.getOptionalDefSchemaId() != null) {
         return (false);
       }
     }
     return (true);
   } else if (obj instanceof CFBamIndexColBuff) {
     CFBamIndexColBuff rhs = (CFBamIndexColBuff) obj;
     if (getOptionalDefSchemaTenantId() != null) {
       if (rhs.getOptionalDefSchemaTenantId() != null) {
         if (!getOptionalDefSchemaTenantId().equals(rhs.getOptionalDefSchemaTenantId())) {
           return (false);
         }
       }
     } else {
       if (rhs.getOptionalDefSchemaTenantId() != null) {
         return (false);
       }
     }
     if (getOptionalDefSchemaId() != null) {
       if (rhs.getOptionalDefSchemaId() != null) {
         if (!getOptionalDefSchemaId().equals(rhs.getOptionalDefSchemaId())) {
           return (false);
         }
       }
     } else {
       if (rhs.getOptionalDefSchemaId() != null) {
         return (false);
       }
     }
     return (true);
   } else {
     return (false);
   }
 }
 public int compareTo(Object obj) {
   if (obj == null) {
     return (1);
   } else if (obj instanceof CFBamIndexColByDefSchemaIdxKey) {
     CFBamIndexColByDefSchemaIdxKey rhs = (CFBamIndexColByDefSchemaIdxKey) obj;
     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);
       }
     }
     return (0);
   } else if (obj instanceof CFBamIndexColBuff) {
     CFBamIndexColBuff rhs = (CFBamIndexColBuff) obj;
     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);
       }
     }
     return (0);
   } else {
     throw CFLib.getDefaultExceptionFactory()
         .newUnsupportedClassException(getClass(), "compareTo", "obj", obj, null);
   }
 }