public int compareTo(Object obj) {
   if (obj == null) {
     return (1);
   } else if (obj instanceof CFSecuritySecGroupFormByGroupIdxKey) {
     CFSecuritySecGroupFormByGroupIdxKey rhs = (CFSecuritySecGroupFormByGroupIdxKey) obj;
     if (getRequiredClusterId() < rhs.getRequiredClusterId()) {
       return (-1);
     } else if (getRequiredClusterId() > rhs.getRequiredClusterId()) {
       return (1);
     }
     if (getRequiredSecGroupId() < rhs.getRequiredSecGroupId()) {
       return (-1);
     } else if (getRequiredSecGroupId() > rhs.getRequiredSecGroupId()) {
       return (1);
     }
     return (0);
   } else if (obj instanceof CFSecuritySecGroupFormBuff) {
     CFSecuritySecGroupFormBuff rhs = (CFSecuritySecGroupFormBuff) obj;
     if (getRequiredClusterId() < rhs.getRequiredClusterId()) {
       return (-1);
     } else if (getRequiredClusterId() > rhs.getRequiredClusterId()) {
       return (1);
     }
     if (getRequiredSecGroupId() < rhs.getRequiredSecGroupId()) {
       return (-1);
     } else if (getRequiredSecGroupId() > rhs.getRequiredSecGroupId()) {
       return (1);
     }
     return (0);
   } else {
     throw CFLib.getDefaultExceptionFactory()
         .newUnsupportedClassException(getClass(), "compareTo", "obj", obj, null);
   }
 }
 public boolean equals(Object obj) {
   if (obj == null) {
     return (false);
   } else if (obj instanceof CFSecuritySecGroupFormByGroupIdxKey) {
     CFSecuritySecGroupFormByGroupIdxKey rhs = (CFSecuritySecGroupFormByGroupIdxKey) obj;
     if (getRequiredClusterId() != rhs.getRequiredClusterId()) {
       return (false);
     }
     if (getRequiredSecGroupId() != rhs.getRequiredSecGroupId()) {
       return (false);
     }
     return (true);
   } else if (obj instanceof CFSecuritySecGroupFormBuff) {
     CFSecuritySecGroupFormBuff rhs = (CFSecuritySecGroupFormBuff) obj;
     if (getRequiredClusterId() != rhs.getRequiredClusterId()) {
       return (false);
     }
     if (getRequiredSecGroupId() != rhs.getRequiredSecGroupId()) {
       return (false);
     }
     return (true);
   } else {
     return (false);
   }
 }
 public void copyBuffToPKey() {
   getPKey().setRequiredClusterId(buff.getRequiredClusterId());
   getPKey().setRequiredSecGroupFormId(buff.getRequiredSecGroupFormId());
 }