public CFInternetTopDomainBuff lockBuff(
     CFSecurityAuthorization Authorization, CFInternetDomainBasePKey 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();
     long Id = PKey.getRequiredId();
     final String sql = "CALL sp_lock_tdomdef( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " )";
     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.setLong(argIdx++, Id);
     resultSet = stmtLockBuffByPKey.executeQuery();
     if (resultSet.next()) {
       CFInternetTopDomainBuff buff = unpackTopDomainResultSetToBuff(resultSet);
       if (resultSet.next()) {
         resultSet.last();
         throw CFLib.getDefaultExceptionFactory()
             .newRuntimeException(
                 getClass(),
                 S_ProcName,
                 "Did not expect multi-record response, " + resultSet.getRow() + " rows selected");
       }
       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 CFInternetTopDomainBuff[] readDerivedByTldIdx(
     CFSecurityAuthorization Authorization, long TenantId, long TldId) {
   final String S_ProcName = "readDerivedByTldIdx";
   if (!schema.isTransactionOpen()) {
     throw CFLib.getDefaultExceptionFactory()
         .newUsageException(getClass(), S_ProcName, "Transaction not open");
   }
   CFInternetTopDomainBuff[] buffList = readBuffByTldIdx(Authorization, TenantId, TldId);
   return (buffList);
 }
 public CFInternetTopDomainBuff[] readAllDerived(CFSecurityAuthorization Authorization) {
   final String S_ProcName = "readAllDerived";
   CFInternetTopDomainBuff[] buffArray;
   if (!schema.isTransactionOpen()) {
     throw CFLib.getDefaultExceptionFactory()
         .newUsageException(getClass(), S_ProcName, "Transaction not open");
   }
   buffArray = readAllBuff(Authorization);
   return (buffArray);
 }
 public CFInternetTopDomainBuff readDerivedByNameIdx(
     CFSecurityAuthorization Authorization, long TenantId, long TldId, String Name) {
   final String S_ProcName = "CFDbTestDb2LUWTopDomainTable.readDerivedByNameIdx() ";
   CFInternetTopDomainBuff buff;
   if (!schema.isTransactionOpen()) {
     throw CFLib.getDefaultExceptionFactory()
         .newUsageException(getClass(), S_ProcName, "Transaction not open");
   }
   buff = readBuffByNameIdx(Authorization, TenantId, TldId, Name);
   return (buff);
 }
 public CFInternetTopDomainBuff lockDerived(
     CFSecurityAuthorization Authorization, CFInternetDomainBasePKey PKey) {
   final String S_ProcName = "lockDerived";
   if (!schema.isTransactionOpen()) {
     throw CFLib.getDefaultExceptionFactory()
         .newUsageException(getClass(), S_ProcName, "Transaction not open");
   }
   CFInternetTopDomainBuff buff;
   buff = lockBuff(Authorization, PKey);
   return (buff);
 }
 public CFSecurityAuditActionBuff readDerivedByUDescrIdx(
     CFSecurityAuthorization Authorization, String Description) {
   final String S_ProcName = "CFDbTestDb2LUWAuditActionTable.readDerivedByUDescrIdx() ";
   CFSecurityAuditActionBuff buff;
   if (!schema.isTransactionOpen()) {
     throw CFLib.getDefaultExceptionFactory()
         .newUsageException(getClass(), S_ProcName, "Transaction not open");
   }
   buff = readBuffByUDescrIdx(Authorization, Description);
   return (buff);
 }
 public CFSecurityAuditActionBuff readDerived(
     CFSecurityAuthorization Authorization, CFSecurityAuditActionPKey PKey) {
   final String S_ProcName = "readDerived";
   if (!schema.isTransactionOpen()) {
     throw CFLib.getDefaultExceptionFactory()
         .newUsageException(getClass(), S_ProcName, "Transaction not open");
   }
   CFSecurityAuditActionBuff buff;
   buff = readBuff(Authorization, PKey);
   return (buff);
 }
 public CFInternetTopDomainBuff[] readAllBuff(CFSecurityAuthorization Authorization) {
   final String S_ProcName = "readAllBuff";
   if (!schema.isTransactionOpen()) {
     throw CFLib.getDefaultExceptionFactory()
         .newUsageException(getClass(), S_ProcName, "Transaction not open");
   }
   ResultSet resultSet = null;
   try {
     Connection cnx = schema.getCnx();
     final String sql = "CALL sp_read_tdomdef_all( ?, ?, ?, ?, ? )";
     if (stmtReadAllBuff == null) {
       stmtReadAllBuff = cnx.prepareStatement(sql);
     }
     int argIdx = 1;
     stmtReadAllBuff.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadAllBuff.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString());
     stmtReadAllBuff.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
     stmtReadAllBuff.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadAllBuff.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
     resultSet = stmtReadAllBuff.executeQuery();
     List<CFInternetTopDomainBuff> buffList = new LinkedList<CFInternetTopDomainBuff>();
     while (resultSet.next()) {
       CFInternetTopDomainBuff buff = unpackTopDomainResultSetToBuff(resultSet);
       buffList.add(buff);
     }
     int idx = 0;
     CFInternetTopDomainBuff[] retBuff = new CFInternetTopDomainBuff[buffList.size()];
     Iterator<CFInternetTopDomainBuff> iter = buffList.iterator();
     while (iter.hasNext()) {
       retBuff[idx++] = iter.next();
     }
     return (retBuff);
   } catch (SQLException e) {
     throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
   } finally {
     if (resultSet != null) {
       try {
         resultSet.close();
       } catch (SQLException e) {
       }
       resultSet = null;
     }
   }
 }
 public void createAuditAction(
     CFSecurityAuthorization Authorization, CFSecurityAuditActionBuff Buff) {
   final String S_ProcName = "createAuditAction";
   if (!schema.isTransactionOpen()) {
     throw CFLib.getDefaultExceptionFactory()
         .newUsageException(getClass(), S_ProcName, "Transaction not open");
   }
   ResultSet resultSet = null;
   try {
     ICFSecuritySchema.AuditActionEnum AuditActionId = Buff.getRequiredAuditActionId();
     String Description = Buff.getRequiredDescription();
     Connection cnx = schema.getCnx();
     final String sql =
         "CALL sp_create_auditaction( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " )";
     if (stmtCreateByPKey == null) {
       stmtCreateByPKey = cnx.prepareStatement(sql);
     }
     int argIdx = 1;
     stmtCreateByPKey.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtCreateByPKey.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString());
     stmtCreateByPKey.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
     stmtCreateByPKey.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtCreateByPKey.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
     stmtCreateByPKey.setString(argIdx++, "AUDT");
     stmtCreateByPKey.setShort(argIdx++, (short) AuditActionId.ordinal());
     stmtCreateByPKey.setString(argIdx++, Description);
     resultSet = stmtCreateByPKey.executeQuery();
     if (resultSet.next()) {
       CFSecurityAuditActionBuff createdBuff = unpackAuditActionResultSetToBuff(resultSet);
       if (resultSet.next()) {
         resultSet.last();
         throw CFLib.getDefaultExceptionFactory()
             .newRuntimeException(
                 getClass(),
                 S_ProcName,
                 "Did not expect multi-record response, " + resultSet.getRow() + " rows selected");
       }
       Buff.setRequiredAuditActionId(createdBuff.getRequiredAuditActionId());
       Buff.setRequiredDescription(createdBuff.getRequiredDescription());
       Buff.setRequiredRevision(createdBuff.getRequiredRevision());
     } else {
       throw CFLib.getDefaultExceptionFactory()
           .newRuntimeException(
               getClass(),
               S_ProcName,
               "Expected a single-record response, " + resultSet.getRow() + " rows selected");
     }
   } catch (SQLException e) {
     throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
   } finally {
     if (resultSet != null) {
       try {
         resultSet.close();
       } catch (SQLException e) {
       }
       resultSet = null;
     }
   }
 }