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 ICFInternetDomainObj readDomain(CFInternetDomainBasePKey pkey, boolean forceRead) { ICFInternetDomainObj obj = null; if ((!forceRead) && members.containsKey(pkey)) { obj = members.get(pkey); } else { CFInternetDomainBuff readBuff = ((ICFBamSchema) schema.getBackingStore()) .getTableDomain() .readDerivedByIdIdx( schema.getAuthorization(), pkey.getRequiredTenantId(), pkey.getRequiredId()); if (readBuff != null) { obj = (ICFInternetDomainObj) schema.getDomainBaseTableObj().constructByClassCode(readBuff.getClassCode()); obj.setPKey(((ICFBamSchema) schema.getBackingStore()).getFactoryDomainBase().newPKey()); obj.setBuff(readBuff); obj = (ICFInternetDomainObj) obj.realize(); } else if (schema.getCacheMisses()) { members.put(pkey, null); } } return (obj); }
public void deleteTopDomainByIdIdx( CFSecurityAuthorization Authorization, CFInternetDomainBasePKey argKey) { deleteTopDomainByIdIdx(Authorization, argKey.getRequiredTenantId(), argKey.getRequiredId()); }
public boolean equals(Object obj) { if (obj == null) { return (false); } else if (obj instanceof CFInternetMinorVersionBuff) { CFInternetMinorVersionBuff rhs = (CFInternetMinorVersionBuff) obj; if (getRequiredTenantId() != rhs.getRequiredTenantId()) { return (false); } if (getRequiredId() != rhs.getRequiredId()) { return (false); } if (getRequiredMajorId() != rhs.getRequiredMajorId()) { return (false); } if (!getRequiredName().equals(rhs.getRequiredName())) { return (false); } return (true); } else if (obj instanceof CFInternetDomainBasePKey) { CFInternetDomainBasePKey rhs = (CFInternetDomainBasePKey) obj; if (getRequiredTenantId() != rhs.getRequiredTenantId()) { return (false); } if (getRequiredId() != rhs.getRequiredId()) { return (false); } return (true); } else if (obj instanceof CFInternetMinorVersionHBuff) { CFInternetMinorVersionHBuff rhs = (CFInternetMinorVersionHBuff) obj; if (getRequiredTenantId() != rhs.getRequiredTenantId()) { return (false); } if (getRequiredId() != rhs.getRequiredId()) { return (false); } if (getRequiredMajorId() != rhs.getRequiredMajorId()) { return (false); } if (!getRequiredName().equals(rhs.getRequiredName())) { return (false); } return (true); } else if (obj instanceof CFInternetDomainBaseHPKey) { CFInternetDomainBaseHPKey rhs = (CFInternetDomainBaseHPKey) obj; if (getRequiredTenantId() != rhs.getRequiredTenantId()) { return (false); } if (getRequiredId() != rhs.getRequiredId()) { return (false); } return (true); } else if (obj instanceof CFInternetMinorVersionByMajorIdxKey) { CFInternetMinorVersionByMajorIdxKey rhs = (CFInternetMinorVersionByMajorIdxKey) obj; if (getRequiredTenantId() != rhs.getRequiredTenantId()) { return (false); } if (getRequiredMajorId() != rhs.getRequiredMajorId()) { return (false); } return (true); } else if (obj instanceof CFInternetMinorVersionByNameIdxKey) { CFInternetMinorVersionByNameIdxKey rhs = (CFInternetMinorVersionByNameIdxKey) obj; if (getRequiredTenantId() != rhs.getRequiredTenantId()) { return (false); } if (getRequiredMajorId() != rhs.getRequiredMajorId()) { return (false); } if (!getRequiredName().equals(rhs.getRequiredName())) { return (false); } return (true); } else { boolean retval = super.equals(obj); return (retval); } }
public int compareTo(Object obj) { if (obj == null) { return (-1); } else if (obj instanceof CFInternetMinorVersionBuff) { CFInternetMinorVersionBuff rhs = (CFInternetMinorVersionBuff) obj; int retval = super.compareTo(rhs); if (retval != 0) { return (retval); } if (getRequiredMajorId() < rhs.getRequiredMajorId()) { return (-1); } else if (getRequiredMajorId() > rhs.getRequiredMajorId()) { return (1); } { int cmp = getRequiredName().compareTo(rhs.getRequiredName()); if (cmp != 0) { return (cmp); } } return (0); } else if (obj instanceof CFInternetDomainBasePKey) { CFInternetDomainBasePKey rhs = (CFInternetDomainBasePKey) obj; if (getRequiredTenantId() < rhs.getRequiredTenantId()) { return (-1); } else if (getRequiredTenantId() > rhs.getRequiredTenantId()) { return (1); } if (getRequiredId() < rhs.getRequiredId()) { return (-1); } else if (getRequiredId() > rhs.getRequiredId()) { return (1); } return (0); } else if (obj instanceof CFInternetDomainBaseHPKey) { CFInternetDomainBaseHPKey rhs = (CFInternetDomainBaseHPKey) obj; { int lhsRequiredRevision = getRequiredRevision(); int rhsRequiredRevision = rhs.getRequiredRevision(); if (lhsRequiredRevision < rhsRequiredRevision) { return (-1); } else if (lhsRequiredRevision > rhsRequiredRevision) { return (1); } } if (getRequiredTenantId() < rhs.getRequiredTenantId()) { return (-1); } else if (getRequiredTenantId() > rhs.getRequiredTenantId()) { return (1); } if (getRequiredId() < rhs.getRequiredId()) { return (-1); } else if (getRequiredId() > rhs.getRequiredId()) { return (1); } return (0); } else if (obj instanceof CFInternetMinorVersionHBuff) { CFInternetMinorVersionHBuff rhs = (CFInternetMinorVersionHBuff) obj; int retval = super.compareTo(rhs); if (retval != 0) { return (retval); } if (getRequiredMajorId() < rhs.getRequiredMajorId()) { return (-1); } else if (getRequiredMajorId() > rhs.getRequiredMajorId()) { return (1); } { int cmp = getRequiredName().compareTo(rhs.getRequiredName()); if (cmp != 0) { return (cmp); } } return (0); } else if (obj instanceof CFInternetMinorVersionByMajorIdxKey) { CFInternetMinorVersionByMajorIdxKey rhs = (CFInternetMinorVersionByMajorIdxKey) obj; if (getRequiredTenantId() < rhs.getRequiredTenantId()) { return (-1); } else if (getRequiredTenantId() > rhs.getRequiredTenantId()) { return (1); } if (getRequiredMajorId() < rhs.getRequiredMajorId()) { return (-1); } else if (getRequiredMajorId() > rhs.getRequiredMajorId()) { return (1); } return (0); } else if (obj instanceof CFInternetMinorVersionByNameIdxKey) { CFInternetMinorVersionByNameIdxKey rhs = (CFInternetMinorVersionByNameIdxKey) obj; if (getRequiredTenantId() < rhs.getRequiredTenantId()) { return (-1); } else if (getRequiredTenantId() > rhs.getRequiredTenantId()) { return (1); } if (getRequiredMajorId() < rhs.getRequiredMajorId()) { return (-1); } else if (getRequiredMajorId() > rhs.getRequiredMajorId()) { return (1); } { int cmp = getRequiredName().compareTo(rhs.getRequiredName()); if (cmp != 0) { return (cmp); } } return (0); } else { int retval = super.compareTo(obj); return (retval); } }