public CFSecurityTSecGroupBuff lockBuff(
     CFSecurityAuthorization Authorization, CFSecurityTSecGroupPKey PKey) {
   final String S_ProcName = "lockBuff";
   if (!schema.isTransactionOpen()) {
     throw CFLib.getDefaultExceptionFactory()
         .newUsageException(getClass(), S_ProcName, "Transaction not open");
   }
   ResultSet resultSet = null;
   try {
     Connection cnx = schema.getCnx();
     long TenantId = PKey.getRequiredTenantId();
     int TSecGroupId = PKey.getRequiredTSecGroupId();
     String sql =
         "SELECT * FROM "
             + schema.getLowerDbSchemaName()
             + ".sp_lock_tsecgrp( ?, ?, ?, ?, ?"
             + ", "
             + "?"
             + ", "
             + "?"
             + " )";
     if (stmtLockBuffByPKey == null) {
       stmtLockBuffByPKey = cnx.prepareStatement(sql);
     }
     int argIdx = 1;
     stmtLockBuffByPKey.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtLockBuffByPKey.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString());
     stmtLockBuffByPKey.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
     stmtLockBuffByPKey.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtLockBuffByPKey.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
     stmtLockBuffByPKey.setLong(argIdx++, TenantId);
     stmtLockBuffByPKey.setInt(argIdx++, TSecGroupId);
     resultSet = stmtLockBuffByPKey.executeQuery();
     if (resultSet.next()) {
       CFSecurityTSecGroupBuff buff = unpackTSecGroupResultSetToBuff(resultSet);
       if (resultSet.next()) {
         throw CFLib.getDefaultExceptionFactory()
             .newRuntimeException(getClass(), S_ProcName, "Did not expect multi-record response");
       }
       return (buff);
     } else {
       return (null);
     }
   } catch (SQLException e) {
     throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
   } finally {
     if (resultSet != null) {
       try {
         resultSet.close();
       } catch (SQLException e) {
       }
       resultSet = null;
     }
   }
 }
 public boolean equals(Object obj) {
   if (obj == null) {
     return (false);
   } else if (obj instanceof CFSecurityTSecGroupHPKey) {
     CFSecurityTSecGroupHPKey rhs = (CFSecurityTSecGroupHPKey) obj;
     if (getRequiredTenantId() != rhs.getRequiredTenantId()) {
       return (false);
     }
     if (getRequiredTSecGroupId() != rhs.getRequiredTSecGroupId()) {
       return (false);
     }
     return (true);
   } else if (obj instanceof CFSecurityTSecGroupPKey) {
     CFSecurityTSecGroupPKey rhs = (CFSecurityTSecGroupPKey) obj;
     if (getRequiredTenantId() != rhs.getRequiredTenantId()) {
       return (false);
     }
     if (getRequiredTSecGroupId() != rhs.getRequiredTSecGroupId()) {
       return (false);
     }
     return (true);
   } else if (obj instanceof CFSecurityTSecGroupHBuff) {
     CFSecurityTSecGroupHBuff rhs = (CFSecurityTSecGroupHBuff) obj;
     if (getRequiredTenantId() != rhs.getRequiredTenantId()) {
       return (false);
     }
     if (getRequiredTSecGroupId() != rhs.getRequiredTSecGroupId()) {
       return (false);
     }
     return (true);
   } else if (obj instanceof CFSecurityTSecGroupBuff) {
     CFSecurityTSecGroupBuff rhs = (CFSecurityTSecGroupBuff) obj;
     if (getRequiredTenantId() != rhs.getRequiredTenantId()) {
       return (false);
     }
     if (getRequiredTSecGroupId() != rhs.getRequiredTSecGroupId()) {
       return (false);
     }
     return (true);
   } else {
     return (false);
   }
 }
 public void deleteTSecGroupByIdIdx(
     CFSecurityAuthorization Authorization, CFSecurityTSecGroupPKey argKey) {
   deleteTSecGroupByIdIdx(
       Authorization, argKey.getRequiredTenantId(), argKey.getRequiredTSecGroupId());
 }
 public int compareTo(Object obj) {
   if (obj == null) {
     return (-1);
   } else if (obj instanceof CFSecurityTSecGroupHPKey) {
     CFSecurityTSecGroupHPKey rhs = (CFSecurityTSecGroupHPKey) obj;
     if (getRequiredTenantId() < rhs.getRequiredTenantId()) {
       return (-1);
     } else if (getRequiredTenantId() > rhs.getRequiredTenantId()) {
       return (1);
     }
     if (getRequiredTSecGroupId() < rhs.getRequiredTSecGroupId()) {
       return (-1);
     } else if (getRequiredTSecGroupId() > rhs.getRequiredTSecGroupId()) {
       return (1);
     }
     return (0);
   } else if (obj instanceof CFSecurityTSecGroupPKey) {
     CFSecurityTSecGroupPKey rhs = (CFSecurityTSecGroupPKey) obj;
     if (getRequiredTenantId() < rhs.getRequiredTenantId()) {
       return (-1);
     } else if (getRequiredTenantId() > rhs.getRequiredTenantId()) {
       return (1);
     }
     if (getRequiredTSecGroupId() < rhs.getRequiredTSecGroupId()) {
       return (-1);
     } else if (getRequiredTSecGroupId() > rhs.getRequiredTSecGroupId()) {
       return (1);
     }
     return (0);
   } else if (obj instanceof CFSecurityTSecGroupBuff) {
     CFSecurityTSecGroupBuff rhs = (CFSecurityTSecGroupBuff) obj;
     if (getRequiredTenantId() < rhs.getRequiredTenantId()) {
       return (-1);
     } else if (getRequiredTenantId() > rhs.getRequiredTenantId()) {
       return (1);
     }
     if (getRequiredTSecGroupId() < rhs.getRequiredTSecGroupId()) {
       return (-1);
     } else if (getRequiredTSecGroupId() > rhs.getRequiredTSecGroupId()) {
       return (1);
     }
     return (0);
   } else if (obj instanceof CFSecurityTSecGroupHBuff) {
     CFSecurityTSecGroupHBuff rhs = (CFSecurityTSecGroupHBuff) obj;
     if (getRequiredTenantId() < rhs.getRequiredTenantId()) {
       return (-1);
     } else if (getRequiredTenantId() > rhs.getRequiredTenantId()) {
       return (1);
     }
     if (getRequiredTSecGroupId() < rhs.getRequiredTSecGroupId()) {
       return (-1);
     } else if (getRequiredTSecGroupId() > rhs.getRequiredTSecGroupId()) {
       return (1);
     }
     return (0);
   } else {
     throw CFLib.getDefaultExceptionFactory()
         .newUnsupportedClassException(
             getClass(),
             "compareTo",
             "obj",
             obj,
             "CFSecurityTSecGroupPKey, CFSecurityTSecGroupBuff");
   }
 }