public boolean equals(Object obj) { if (obj == null) { return (false); } else if (obj instanceof CFSecuritySysClusterHBuff) { CFSecuritySysClusterHBuff rhs = (CFSecuritySysClusterHBuff) obj; if (!super.equals(obj)) { return (false); } if (getRequiredSingletonId() != rhs.getRequiredSingletonId()) { return (false); } if (getRequiredClusterId() != rhs.getRequiredClusterId()) { return (false); } return (true); } else if (obj instanceof CFSecuritySysClusterBuff) { CFSecuritySysClusterBuff rhs = (CFSecuritySysClusterBuff) obj; if (!super.equals(obj)) { return (false); } if (getRequiredSingletonId() != rhs.getRequiredSingletonId()) { return (false); } if (getRequiredClusterId() != rhs.getRequiredClusterId()) { return (false); } return (true); } else if (obj instanceof CFSecuritySysClusterByClusterIdxKey) { CFSecuritySysClusterByClusterIdxKey rhs = (CFSecuritySysClusterByClusterIdxKey) obj; if (getRequiredClusterId() != rhs.getRequiredClusterId()) { return (false); } return (true); } else if (obj instanceof CFSecuritySysClusterHPKey) { CFSecuritySysClusterHPKey rhs = (CFSecuritySysClusterHPKey) obj; { long lhsClusterId = getAuditClusterId(); long rhsClusterId = rhs.getAuditClusterId(); if (lhsClusterId != rhsClusterId) { return (false); } } { Calendar lhsAuditStamp = getAuditStamp(); Calendar rhsAuditStamp = rhs.getAuditStamp(); if (lhsAuditStamp != null) { if (rhsAuditStamp != null) { if (!lhsAuditStamp.equals(rhsAuditStamp)) { return (false); } } else { return (false); } } else { return (false); } } { short lhsActionId = getAuditActionId(); short rhsActionId = rhs.getAuditActionId(); if (lhsActionId != rhsActionId) { return (false); } } { int lhsRevision = getRequiredRevision(); int rhsRevision = rhs.getRequiredRevision(); if (lhsRevision != rhsRevision) { return (false); } } { UUID lhsAuditSessionId = getAuditSessionId(); UUID rhsAuditSessionId = rhs.getAuditSessionId(); if (lhsAuditSessionId != null) { if (rhsAuditSessionId != null) { if (!lhsAuditSessionId.equals(rhsAuditSessionId)) { return (false); } } else { return (false); } } else { return (false); } } if (getRequiredSingletonId() != rhs.getRequiredSingletonId()) { return (false); } return (true); } else if (obj instanceof CFSecurityHPKey) { CFSecurityHPKey rhs = (CFSecurityHPKey) obj; { long lhsClusterId = getAuditClusterId(); long rhsClusterId = rhs.getAuditClusterId(); if (lhsClusterId != rhsClusterId) { return (false); } } { Calendar lhsAuditStamp = getAuditStamp(); Calendar rhsAuditStamp = rhs.getAuditStamp(); if (lhsAuditStamp != null) { if (rhsAuditStamp != null) { if (!lhsAuditStamp.equals(rhsAuditStamp)) { return (false); } } else { return (false); } } else { return (false); } } { short lhsActionId = getAuditActionId(); short rhsActionId = rhs.getAuditActionId(); if (lhsActionId != rhsActionId) { return (false); } } { int lhsRevision = getRequiredRevision(); int rhsRevision = rhs.getRequiredRevision(); if (lhsRevision != rhsRevision) { return (false); } } { UUID lhsAuditSessionId = getAuditSessionId(); UUID rhsAuditSessionId = rhs.getAuditSessionId(); if (lhsAuditSessionId != null) { if (rhsAuditSessionId != null) { if (!lhsAuditSessionId.equals(rhsAuditSessionId)) { return (false); } } else { return (false); } } else { return (false); } } return (true); } else if (obj instanceof CFSecuritySysClusterPKey) { CFSecuritySysClusterPKey rhs = (CFSecuritySysClusterPKey) obj; if (getRequiredSingletonId() != rhs.getRequiredSingletonId()) { return (false); } return (true); } else { return (super.equals(obj)); } }
public void deleteSysCluster( CFSecurityAuthorization Authorization, CFSecuritySysClusterBuff Buff) { final String S_ProcName = "deleteSysCluster"; ResultSet resultSet = null; try { Connection cnx = schema.getCnx(); int SingletonId = Buff.getRequiredSingletonId(); final String sql = "CALL sp_delete_sysclus( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " )"; if (stmtDeleteByPKey == null) { stmtDeleteByPKey = cnx.prepareStatement(sql); } int argIdx = 1; stmtDeleteByPKey.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtDeleteByPKey.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtDeleteByPKey.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtDeleteByPKey.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtDeleteByPKey.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtDeleteByPKey.setInt(argIdx++, SingletonId); stmtDeleteByPKey.setInt(argIdx++, Buff.getRequiredRevision()); ; resultSet = stmtDeleteByPKey.executeQuery(); if (resultSet.next()) { int deleteFlag = resultSet.getInt(1); if (resultSet.next()) { resultSet.last(); throw CFLib.getDefaultExceptionFactory() .newRuntimeException( getClass(), S_ProcName, "Did not expect multi-record response, " + resultSet.getRow() + " rows selected"); } } else { throw CFLib.getDefaultExceptionFactory() .newRuntimeException( getClass(), S_ProcName, "Expected 1 record result set to be returned by delete, not 0 rows"); } } 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 setSysClusterBuff(CFSecuritySysClusterBuff src) { setRequiredSingletonId(src.getRequiredSingletonId()); setRequiredClusterId(src.getRequiredClusterId()); setRequiredRevision(src.getRequiredRevision()); }
public void copyBuffToPKey() { getPKey().setRequiredSingletonId(buff.getRequiredSingletonId()); }
public static String formatSysClusterPKeyAttributes( String separator, CFSecuritySysClusterBuff buff) { String retval = CFLibXmlUtil.formatRequiredInt32(separator, "SingletonId", buff.getRequiredSingletonId()); return (retval); }
public void createSysCluster( CFSecurityAuthorization Authorization, CFSecuritySysClusterBuff Buff) { final String S_ProcName = "createSysCluster"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory() .newUsageException(getClass(), S_ProcName, "Transaction not open"); } ResultSet resultSet = null; try { int SingletonId = Buff.getRequiredSingletonId(); long ClusterId = Buff.getRequiredClusterId(); Connection cnx = schema.getCnx(); final String sql = "CALL sp_create_sysclus( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " )"; 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++, "SYSC"); stmtCreateByPKey.setInt(argIdx++, SingletonId); stmtCreateByPKey.setLong(argIdx++, ClusterId); resultSet = stmtCreateByPKey.executeQuery(); if (resultSet.next()) { CFSecuritySysClusterBuff createdBuff = unpackSysClusterResultSetToBuff(resultSet); if (resultSet.next()) { resultSet.last(); throw CFLib.getDefaultExceptionFactory() .newRuntimeException( getClass(), S_ProcName, "Did not expect multi-record response, " + resultSet.getRow() + " rows selected"); } Buff.setRequiredSingletonId(createdBuff.getRequiredSingletonId()); Buff.setRequiredClusterId(createdBuff.getRequiredClusterId()); 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; } } }