/** * Set up/do the remote criteria. * @param strbFilter The SQL query string to add to. * @param bIncludeFileName Include the file name with this query? * @param vParamList The param list to add the raw data to (for prepared statements). * @return True if you should not skip this record (does a check on the local data). */ public boolean doRemoteCriteria(StringBuffer strbFilter, boolean bIncludeFileName, Vector vParamList) { boolean bDontSkip; if (strbFilter != null) if (strbFilter.length() != 0) strbFilter.append(" AND "); if (strbFilter != null) strbFilter.append("("); boolean bDontSkip2 = this.fieldCompare(m_fldToCheck, m_fldToCompare, m_strSeekSign, strbFilter, bIncludeFileName, vParamList); if (strbFilter != null) strbFilter.append(" OR "); boolean bDontSkip3 = this.fieldCompare(m_fldToCheck, (String)null, "=", strbFilter, bIncludeFileName, vParamList); // Is null if (strbFilter != null) strbFilter.append(") "); if (strbFilter != null) bDontSkip = true; // Don't need to compare, if I'm creating a filter to pass to SQL else bDontSkip = (bDontSkip2 | bDontSkip3); if (bDontSkip) return super.doRemoteCriteria(strbFilter, bIncludeFileName, vParamList); // Dont skip this record else return false; // Skip this one }
public boolean doRemoteCriteria(StringBuffer strbFilter, boolean bIncludeFileName, Vector<BaseField> vParamList) { BaseField fldToCompare = m_fldToCompare; // Cache this in case it is changed KeyArea keyArea = this.getOwner().getKeyArea(); m_fldToCheck = keyArea.getField(DBConstants.MAIN_KEY_FIELD); String strSeekSignSave = m_strSeekSign; if (m_strSeekSign == DBConstants.BLANK) { m_strSeekSign = GREATER_THAN_EQUAL; if (keyArea.getKeyOrder(DBConstants.MAIN_KEY_FIELD) == DBConstants.DESCENDING) m_strSeekSign = LESS_THAN_EQUAL; } // Now, we have to convert the field to a CDate for the compare to use if (m_fldToCheck instanceof DateField) this.fakeTheDate(); // Convert the string field to a date for compare boolean bDontSkip = super.doRemoteCriteria(strbFilter, bIncludeFileName, vParamList); // Dont skip this record m_fldToCheck = null; m_fldToCompare = fldToCompare; // Set this value back m_strSeekSign = strSeekSignSave; // Restore this. return bDontSkip; } public static final String FAKE_DATE = "Fake Date";
public boolean doRemoteCriteria(StringBuffer strbFilter, boolean bIncludeFileName, Vector<BaseField> vParamList) { BaseField fldToCompare = m_fldToCompare; // Cache this in case it is changed KeyArea keyArea = this.getOwner().getKeyArea(); m_fldToCheck = keyArea.getField(DBConstants.MAIN_KEY_FIELD); String strSeekSignSave = m_strSeekSign; if (m_strSeekSign == DBConstants.BLANK) { m_strSeekSign = GREATER_THAN_EQUAL; if (keyArea.getKeyOrder(DBConstants.MAIN_KEY_FIELD) == DBConstants.DESCENDING) m_strSeekSign = LESS_THAN_EQUAL; } // Now, we have to convert the field to a CDate for the compare to use if (m_fldToCheck instanceof DateField) this.fakeTheDate(); // Convert the string field to a date for compare boolean bDontSkip = super.doRemoteCriteria(strbFilter, bIncludeFileName, vParamList); // Dont skip this record m_fldToCheck = null; m_fldToCompare = fldToCompare; // Set this value back m_strSeekSign = strSeekSignSave; // Restore this. return bDontSkip; } public static final String FAKE_DATE = "Fake Date";
public boolean doRemoteCriteria(StringBuffer strbFilter, boolean bIncludeFileName, Vector<BaseField> vParamList) { BaseField fldToCompare = m_fldToCompare; // Cache this in case it is changed KeyArea keyArea = this.getOwner().getKeyArea(); m_fldToCheck = keyArea.getField(DBConstants.MAIN_KEY_FIELD); String strSeekSignSave = m_strSeekSign; if (m_strSeekSign == DBConstants.BLANK) { m_strSeekSign = GREATER_THAN_EQUAL; if (keyArea.getKeyOrder(DBConstants.MAIN_KEY_FIELD) == DBConstants.DESCENDING) m_strSeekSign = LESS_THAN_EQUAL; } // Now, we have to convert the field to a CDate for the compare to use if (m_fldToCheck instanceof DateField) this.fakeTheDate(); // Convert the string field to a date for compare boolean bDontSkip = super.doRemoteCriteria(strbFilter, bIncludeFileName, vParamList); // Dont skip this record m_fldToCheck = null; m_fldToCompare = fldToCompare; // Set this value back m_strSeekSign = strSeekSignSave; // Restore this. return bDontSkip; } public static final String FAKE_DATE = "Fake Date";