public int compareTo(Object obj) {
   if (obj == null) {
     return (-1);
   } else if (obj instanceof CFBamValueHBuff) {
     CFBamValueHBuff rhs = (CFBamValueHBuff) 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);
         }
       }
     }
     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);
     }
     return (0);
   } else if (obj instanceof CFBamValueHPKey) {
     CFBamValueHPKey rhs = (CFBamValueHPKey) 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 (getRequiredId() < rhs.getRequiredId()) {
       return (-1);
     } else if (getRequiredId() > rhs.getRequiredId()) {
       return (1);
     }
     return (0);
   } else if (obj instanceof CFBamHPKey) {
     CFBamHPKey rhs = (CFBamHPKey) 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);
         }
       }
     }
     return (0);
   } else if (obj instanceof CFBamValuePKey) {
     CFBamValuePKey rhs = (CFBamValuePKey) obj;
     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);
     }
     return (0);
   } else if (obj instanceof CFBamValueBuff) {
     CFBamValueBuff rhs = (CFBamValueBuff) obj;
     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);
     }
     return (0);
   } else {
     throw CFLib.getDefaultExceptionFactory()
         .newUnsupportedClassException(
             getClass(),
             "compareTo",
             "obj",
             obj,
             "CFBamValueHPKey, CFBamValuePKey, CFBamValueBuff");
   }
 }
 public boolean equals(Object obj) {
   if (obj == null) {
     return (false);
   } else if (obj instanceof CFBamValueHPKey) {
     CFBamValueHPKey rhs = (CFBamValueHPKey) 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 (getRequiredId() != rhs.getRequiredId()) {
       return (false);
     }
     return (true);
   } else if (obj instanceof CFBamHPKey) {
     CFBamHPKey rhs = (CFBamHPKey) 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 CFBamValuePKey) {
     CFBamValuePKey rhs = (CFBamValuePKey) obj;
     if (getRequiredTenantId() != rhs.getRequiredTenantId()) {
       return (false);
     }
     if (getRequiredId() != rhs.getRequiredId()) {
       return (false);
     }
     return (true);
   } else if (obj instanceof CFBamValueHBuff) {
     CFBamValueHBuff rhs = (CFBamValueHBuff) 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 (getRequiredId() != rhs.getRequiredId()) {
       return (false);
     }
     if (getRequiredTenantId() != rhs.getRequiredTenantId()) {
       return (false);
     }
     if (getRequiredId() != rhs.getRequiredId()) {
       return (false);
     }
     return (true);
   } else if (obj instanceof CFBamValueBuff) {
     CFBamValueBuff rhs = (CFBamValueBuff) obj;
     if (getRequiredTenantId() != rhs.getRequiredTenantId()) {
       return (false);
     }
     if (getRequiredId() != rhs.getRequiredId()) {
       return (false);
     }
     return (true);
   } else {
     return (false);
   }
 }