public void deleteISOCountryByIdIdx(short Id) { CFSecurityISOCountryPKey pkey = ((ICFInternetSchema) schema.getBackingStore()).getFactoryISOCountry().newPKey(); pkey.setRequiredId(Id); ICFSecurityISOCountryObj obj = readISOCountry(pkey); if (obj != null) { ICFSecurityISOCountryEditObj editObj = (ICFSecurityISOCountryEditObj) obj.getEdit(); boolean editStarted; if (editObj == null) { editObj = (ICFSecurityISOCountryEditObj) 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 ICFSecurityISOCountryObj readISOCountryByIdIdx(short Id, boolean forceRead) { CFSecurityISOCountryPKey pkey = ((ICFInternetSchema) schema.getBackingStore()).getFactoryISOCountry().newPKey(); pkey.setRequiredId(Id); ICFSecurityISOCountryObj obj = readISOCountry(pkey, forceRead); return (obj); }
public void forgetISOCountryByIdIdx(short Id) { if (members == null) { return; } CFSecurityISOCountryPKey key = ((ICFInternetSchema) schema.getBackingStore()).getFactoryISOCountry().newPKey(); key.setRequiredId(Id); if (members.containsKey(key)) { ICFSecurityISOCountryObj probed = members.get(key); if (probed != null) { probed.forget(true); } } }
public CFSecurityISOCountryBuff readBuff( CFSecurityAuthorization Authorization, CFSecurityISOCountryPKey PKey) { final String S_ProcName = "readBuff"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory() .newUsageException(getClass(), S_ProcName, "Transaction not open"); } ResultSet resultSet = null; try { Connection cnx = schema.getCnx(); short Id = PKey.getRequiredId(); String sql = "{ call sp_read_iso_cntry( ?, ?, ?, ?, ?" + ", " + "?" + " ) }"; if (stmtReadBuffByPKey == null) { stmtReadBuffByPKey = cnx.prepareStatement(sql); } int argIdx = 1; stmtReadBuffByPKey.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByPKey.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByPKey.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByPKey.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByPKey.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtReadBuffByPKey.setShort(argIdx++, Id); resultSet = stmtReadBuffByPKey.executeQuery(); if ((resultSet != null) && resultSet.next()) { CFSecurityISOCountryBuff buff = unpackISOCountryResultSetToBuff(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 ICFSecurityISOCountryObj readISOCountry(CFSecurityISOCountryPKey pkey, boolean forceRead) { ICFSecurityISOCountryObj obj = null; if ((!forceRead) && members.containsKey(pkey)) { obj = members.get(pkey); } else { CFSecurityISOCountryBuff readBuff = ((ICFInternetSchema) schema.getBackingStore()) .getTableISOCountry() .readDerivedByIdIdx(schema.getAuthorization(), pkey.getRequiredId()); if (readBuff != null) { obj = schema.getISOCountryTableObj().newInstance(); obj.setPKey( ((ICFInternetSchema) schema.getBackingStore()).getFactoryISOCountry().newPKey()); obj.setBuff(readBuff); obj = (ICFSecurityISOCountryObj) obj.realize(); } else if (schema.getCacheMisses()) { members.put(pkey, null); } } return (obj); }
public void deleteISOCountryByIdIdx( CFSecurityAuthorization Authorization, CFSecurityISOCountryPKey argKey) { deleteISOCountryByIdIdx(Authorization, argKey.getRequiredId()); }
public static String formatISOCountryPKeyAttributes( String separator, CFSecurityISOCountryPKey pkey) { String retval = CFLibXmlUtil.formatRequiredInt16(null, "Id", pkey.getRequiredId()); return (retval); }
public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException { CFBamXMsgSchemaMessageFormatter schemaFormatter = null; try { // Common XML Attributes String attrId = null; // Primary Key Attributes for Constant Enum support // Attribute Extraction String attrLocalName; int numAttrs; int idxAttr; final String S_ProcName = "startElement"; final String S_LocalName = "LocalName"; assert qName.equals("RqstISOCountryRead"); CFBamXMsgRqstHandler xmsgRqstHandler = (CFBamXMsgRqstHandler) getParser(); if (xmsgRqstHandler == null) { throw CFLib.getDefaultExceptionFactory() .newNullArgumentException(getClass(), S_ProcName, 0, "getParser()"); } schemaFormatter = xmsgRqstHandler.getSchemaMessageFormatter(); ICFBamSchemaObj schemaObj = xmsgRqstHandler.getSchemaObj(); if (schemaObj == null) { throw CFLib.getDefaultExceptionFactory() .newNullArgumentException(getClass(), S_ProcName, 0, "getParser().getSchemaObj()"); } // Instantiate a PKey buffer for the parsed information CFSecurityISOCountryPKey pkey = ((ICFBamSchema) schemaObj.getBackingStore()).getFactoryISOCountry().newPKey(); // Extract Attributes numAttrs = attrs.getLength(); for (idxAttr = 0; idxAttr < numAttrs; idxAttr++) { attrLocalName = attrs.getLocalName(idxAttr); if (attrLocalName.equals("Id")) { if (attrId != null) { throw CFLib.getDefaultExceptionFactory() .newUniqueIndexViolationException( getClass(), S_ProcName, S_LocalName, attrLocalName); } attrId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("schemaLocation")) { // ignored } else { throw CFLib.getDefaultExceptionFactory() .newUnrecognizedAttributeException( getClass(), S_ProcName, getParser().getLocationInfo(), attrLocalName); } } // Ensure that required attributes have values if ((attrId == null) || (attrId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory() .newNullArgumentException(getClass(), S_ProcName, 0, "Id"); } // Get current context CFLibXmlCoreContext curContext = getParser().getCurContext(); // Convert string attributes to native Java types // and apply the converted attributes to the editBuff. short natId; natId = Short.parseShort(attrId); pkey.setRequiredId(natId); pkey.setRequiredId(natId); // Read the object and prepare the XML response ICFBamISOCountryObj read = ((ICFBamISOCountryObj) schemaObj.getISOCountryTableObj().readISOCountry(pkey, true)); if (read != null) { String response = schemaFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFBamXMsgISOCountryMessageFormatter.formatISOCountryRspnSingleOpenTag() + CFBamXMsgISOCountryMessageFormatter.formatISOCountryRspnDerivedRec( "\n\t\t", read.getISOCountryBuff()) + "\n" + "\t" + CFBamXMsgISOCountryMessageFormatter.formatISOCountryRspnSingleCloseTag() + schemaFormatter.formatRspnXmlPostamble(); xmsgRqstHandler.appendResponse(response); } else { String response = schemaFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFBamXMsgSchemaMessageFormatter.formatRspnNoDataFound() + "\n" + schemaFormatter.formatRspnXmlPostamble(); xmsgRqstHandler.appendResponse(response); } } catch (RuntimeException e) { CFBamXMsgRqstHandler xmsgRqstHandler = ((CFBamXMsgRqstHandler) getParser()); schemaFormatter = xmsgRqstHandler.getSchemaMessageFormatter(); String response = schemaFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFBamXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e) + "\n" + schemaFormatter.formatRspnXmlPostamble(); xmsgRqstHandler.resetResponse(); xmsgRqstHandler.appendResponse(response); xmsgRqstHandler.setCaughtException(true); } catch (Error e) { CFBamXMsgRqstHandler xmsgRqstHandler = ((CFBamXMsgRqstHandler) getParser()); schemaFormatter = xmsgRqstHandler.getSchemaMessageFormatter(); String response = schemaFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFBamXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e) + "\n" + schemaFormatter.formatRspnXmlPostamble(); xmsgRqstHandler.resetResponse(); xmsgRqstHandler.appendResponse(response); xmsgRqstHandler.setCaughtException(true); } }