public void deleteSecDeviceByIdIdx(UUID SecUserId, String DevName) {
   CFSecuritySecDevicePKey pkey =
       ((ICFSecuritySchema) schema.getBackingStore()).getFactorySecDevice().newPKey();
   pkey.setRequiredSecUserId(SecUserId);
   pkey.setRequiredDevName(DevName);
   ICFSecuritySecDeviceObj obj = readSecDevice(pkey);
   if (obj != null) {
     ICFSecuritySecDeviceEditObj editObj = (ICFSecuritySecDeviceEditObj) obj.getEdit();
     boolean editStarted;
     if (editObj == null) {
       editObj = (ICFSecuritySecDeviceEditObj) obj.beginEdit();
       if (editObj != null) {
         editStarted = true;
       } else {
         editStarted = false;
       }
     } else {
       editStarted = false;
     }
     if (editObj != null) {
       editObj.delete();
       if (editStarted) {
         editObj.endEdit();
       }
     }
     obj.forget(true);
   }
 }
 public CFSecuritySecDeviceBuff lockBuff(
     CFSecurityAuthorization Authorization, CFSecuritySecDevicePKey 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();
     UUID SecUserId = PKey.getRequiredSecUserId();
     String DevName = PKey.getRequiredDevName();
     String sql =
         "SELECT * FROM "
             + schema.getLowerDbSchemaName()
             + ".sp_lock_secdev( ?, ?, ?, ?, ?"
             + ", "
             + "?"
             + ", "
             + "?"
             + " )";
     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.setString(argIdx++, SecUserId.toString());
     stmtLockBuffByPKey.setString(argIdx++, DevName);
     resultSet = stmtLockBuffByPKey.executeQuery();
     if (resultSet.next()) {
       CFSecuritySecDeviceBuff buff = unpackSecDeviceResultSetToBuff(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 ICFSecuritySecDeviceObj readSecDeviceByIdIdx(
     UUID SecUserId, String DevName, boolean forceRead) {
   CFSecuritySecDevicePKey pkey =
       ((ICFSecuritySchema) schema.getBackingStore()).getFactorySecDevice().newPKey();
   pkey.setRequiredSecUserId(SecUserId);
   pkey.setRequiredDevName(DevName);
   ICFSecuritySecDeviceObj obj = readSecDevice(pkey, forceRead);
   return (obj);
 }
 public void forgetSecDeviceByIdIdx(UUID SecUserId, String DevName) {
   if (members == null) {
     return;
   }
   CFSecuritySecDevicePKey key =
       ((ICFSecuritySchema) schema.getBackingStore()).getFactorySecDevice().newPKey();
   key.setRequiredSecUserId(SecUserId);
   key.setRequiredDevName(DevName);
   if (members.containsKey(key)) {
     ICFSecuritySecDeviceObj probed = members.get(key);
     if (probed != null) {
       probed.forget(true);
     }
   }
 }
 public ICFSecuritySecDeviceObj readSecDevice(CFSecuritySecDevicePKey pkey, boolean forceRead) {
   ICFSecuritySecDeviceObj obj = null;
   if ((!forceRead) && members.containsKey(pkey)) {
     obj = members.get(pkey);
   } else {
     CFSecuritySecDeviceBuff readBuff =
         ((ICFSecuritySchema) schema.getBackingStore())
             .getTableSecDevice()
             .readDerivedByIdIdx(
                 schema.getAuthorization(),
                 pkey.getRequiredSecUserId(),
                 pkey.getRequiredDevName());
     if (readBuff != null) {
       obj = schema.getSecDeviceTableObj().newInstance();
       obj.setPKey(((ICFSecuritySchema) schema.getBackingStore()).getFactorySecDevice().newPKey());
       obj.setBuff(readBuff);
       obj = (ICFSecuritySecDeviceObj) obj.realize();
     } else if (schema.getCacheMisses()) {
       members.put(pkey, null);
     }
   }
   return (obj);
 }
 public void deleteSecDeviceByIdIdx(
     CFSecurityAuthorization Authorization, CFSecuritySecDevicePKey argKey) {
   deleteSecDeviceByIdIdx(
       Authorization, argKey.getRequiredSecUserId(), argKey.getRequiredDevName());
 }