/** * Get (or make) the current record for this reference. */ public Record makeReferenceRecord(RecordOwner recordOwner) { Record record = super.makeReferenceRecord(recordOwner); record.addListener(new CompareFileFilter(MessageTransport.kMessageTransportType, MessageTransportTypeField.MANUAL_RESPONSE, DBConstants.EQUALS, null, false)); return record; }
/** * Free this listener. */ public void free() { if (m_fldFakeDate != null) m_fldFakeDate.free(); m_fldFakeDate = null; super.free(); } /*
/** * Creates a new object of the same class as this object. * @return a clone of this instance. * @exception CloneNotSupportedException if the object's class does not support the <code>Cloneable</code> interface. * @see java.lang.Cloneable */ public Object clone() throws CloneNotSupportedException { CompareFileFilter listener = new CompareFileFilter(); listener.init(null, fieldNameToCheck, m_strToCompare, m_strSeekSign, m_convFlag, m_bDontFilterIfNullCompare, m_fldToCheck, m_fldToCompare); return listener; } /**
/** * Use these marshalled params to initialize this object. * Unmarshall the objects and call init. * @param daIn The input stream to unmarshall the data from. */ public void initRemoteSkel(ObjectInputStream daIn) { try { int iFieldSeqToCheck = daIn.readInt(); String strToCompare = (String)daIn.readObject(); String strSeekSign = daIn.readUTF(); BaseField convFlag = this.readField(daIn, (BaseField)m_convFlag); boolean bDontFilterIfNullCompare = daIn.readBoolean(); BaseField fldToCheck = this.readField(daIn, m_fldToCheck); BaseField fldToCompare = this.readField(daIn, m_fldToCompare); m_strFieldNameToCheck = daIn.readUTF(); this.init(null, iFieldSeqToCheck, strToCompare, strSeekSign, convFlag, bDontFilterIfNullCompare, fldToCheck, fldToCompare); } catch (IOException ex) { ex.printStackTrace(); } catch (ClassNotFoundException ex) { ex.printStackTrace(); } } /**
/** * Constructor. * @param fldToCheck The field in this record to compare. * @param szstrSeekSign The comparison sign. * @param pfldToCompare The field to compare the target field to. */ public CompareFileFilter(BaseField fldToCheck, BaseField fldToCompare, String strSeekSign) { this(); this.init(null, null, null, strSeekSign, null, true, fldToCheck, fldToCompare); } /**
BaseField recordField = m_fldToCheck; if (m_fldToCheck == null) recordField = this.getOwner().getField(m_iFieldSeqToCheck); //.getText(recordString); if (m_fldToCompare != null) if (m_bDontFilterIfNullCompare) boolean bDontSkip; if (m_fldToCompare != null) bDontSkip = this.fieldCompare(recordField, m_fldToCompare, m_strSeekSign, strbFilter, bIncludeFileName, vParamList); else bDontSkip = this.fieldCompare(recordField, m_strToCompare, m_strSeekSign, strbFilter, bIncludeFileName, vParamList); if (strbFilter != null) bDontSkip = true; // Don't need to compare, if I'm creating a filter to pass to SQL
/** * 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 }
/** * Constructor. * @param fldToCheck The field in this record to compare. * @param szstrSeekSign The comparison sign. * @param pfldToCompare The field to compare the target field to. */ public CompareFileFilter(BaseField fldToCheck, BaseField fldToCompare, String strSeekSign) { this(); this.init(null, -1, null, strSeekSign, null, true, fldToCheck, fldToCompare); } /**
/** * Use these marshalled params to initialize this object. * Unmarshall the objects and call init. * @param daIn The input stream to unmarshall the data from. */ public void initRemoteSkel(ObjectInputStream daIn) { try { int iFieldSeqToCheck = daIn.readInt(); String strToCompare = (String)daIn.readObject(); String strSeekSign = daIn.readUTF(); BaseField convFlag = this.readField(daIn, (BaseField)m_convFlag); boolean bDontFilterIfNullCompare = daIn.readBoolean(); BaseField fldToCheck = this.readField(daIn, m_fldToCheck); BaseField fldToCompare = this.readField(daIn, m_fldToCompare); m_strFieldNameToCheck = daIn.readUTF(); this.init(null, iFieldSeqToCheck, strToCompare, strSeekSign, convFlag, bDontFilterIfNullCompare, fldToCheck, fldToCompare); } catch (IOException ex) { ex.printStackTrace(); } catch (ClassNotFoundException ex) { ex.printStackTrace(); } } /**
BaseField recordField = m_fldToCheck; if (m_fldToCheck == null) recordField = this.getOwner().getField(m_iFieldSeqToCheck); //.getText(recordString); if (m_fldToCompare != null) if (m_bDontFilterIfNullCompare) boolean bDontSkip; if (m_fldToCompare != null) bDontSkip = this.fieldCompare(recordField, m_fldToCompare, m_strSeekSign, strbFilter, bIncludeFileName, vParamList); else bDontSkip = this.fieldCompare(recordField, m_strToCompare, m_strSeekSign, strbFilter, bIncludeFileName, vParamList); if (strbFilter != null) bDontSkip = true; // Don't need to compare, if I'm creating a filter to pass to SQL
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";
/** * Get (or make) the current record for this reference. */ public Record makeReferenceRecord(RecordOwner recordOwner) { Record record = super.makeReferenceRecord(recordOwner); // Only records with a null in this field record.addListener(new CompareFileFilter(PaxCategory.BASED_PAX_CAT_ID, (String)null, DBConstants.EQUALS, null, false)); return record; }
/** * Creates a new object of the same class as this object. * @return a clone of this instance. * @exception CloneNotSupportedException if the object's class does not support the <code>Cloneable</code> interface. * @see java.lang.Cloneable */ public Object clone() throws CloneNotSupportedException { CompareFileFilter listener = new CompareFileFilter(); listener.init(null, m_iFieldSeqToCheck, m_strToCompare, m_strSeekSign, m_convFlag, m_bDontFilterIfNullCompare, m_fldToCheck, m_fldToCompare); return listener; } /**
/** * Constructor. * @param fsToCheck The field sequence in this record to compare (see m_fldToCheck). * @param szstrSeekSign The comparison sign. * @param pconvFlag If this field is non-null and the state is false, don't do this comparison. * @param bValidOnNull Is this record valid if the compare field is null? */ public CompareFileFilter(String fieldNameToCheck, String strToCompare, String strSeekSign, Converter pconvFlag, boolean bDontFilterIfNullCompare) { this(); this.init(null, fieldNameToCheck, strToCompare, strSeekSign, pconvFlag, bDontFilterIfNullCompare, null, null); } /**
/** * Use these marshalled params to initialize this object. * Unmarshall the objects and call init. * @param daIn The input stream to unmarshall the data from. */ public void initRemoteSkel(ObjectInputStream daIn) { try { String fieldNameToCheck = daIn.readUTF(); if (ProxyConstants.NULL.equals(fieldNameToCheck)) fieldNameToCheck = null; String strToCompare = (String)daIn.readObject(); String strSeekSign = daIn.readUTF(); BaseField convFlag = this.readField(daIn, (BaseField)m_convFlag); boolean bDontFilterIfNullCompare = daIn.readBoolean(); BaseField fldToCheck = this.readField(daIn, m_fldToCheck); BaseField fldToCompare = this.readField(daIn, m_fldToCompare); m_strFieldNameToCheck = daIn.readUTF(); this.init(null, fieldNameToCheck, strToCompare, strSeekSign, convFlag, bDontFilterIfNullCompare, fldToCheck, fldToCompare); } catch (IOException ex) { ex.printStackTrace(); } catch (ClassNotFoundException ex) { ex.printStackTrace(); } } /**
/** * Free Method. */ public void free() { if (m_fldToCheck instanceof BooleanField) { m_fldToCheck.free(); m_fldToCheck = null; } super.free(); } /**
if (m_fldToCheck == null) if (fieldNameToCheck != null) recordField = this.getOwner().getField(fieldNameToCheck); //.getText(recordString); if (m_fldToCompare != null) if (m_bDontFilterIfNullCompare) boolean bDontSkip; if (m_fldToCompare != null) bDontSkip = this.fieldCompare(recordField, m_fldToCompare, m_strSeekSign, strbFilter, bIncludeFileName, vParamList); else bDontSkip = this.fieldCompare(recordField, m_strToCompare, m_strSeekSign, strbFilter, bIncludeFileName, vParamList); if (strbFilter != null) bDontSkip = true; // Don't need to compare, if I'm creating a filter to pass to SQL
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";
/** * Get (or make) the current record for this reference. */ public Record makeReferenceRecord(RecordOwner recordOwner) { Record record = super.makeReferenceRecord(recordOwner); record.addListener(new CompareFileFilter(ContactType.kLevel, "1", DBConstants.EQUALS, null, true)); return record; }
/** * Creates a new object of the same class as this object. * @return a clone of this instance. * @exception CloneNotSupportedException if the object's class does not support the <code>Cloneable</code> interface. * @see java.lang.Cloneable */ public Object clone() throws CloneNotSupportedException { CompareFileFilter listener = new CompareFileFilter(); listener.init(null, m_iFieldSeqToCheck, m_strToCompare, m_strSeekSign, m_convFlag, m_bDontFilterIfNullCompare, m_fldToCheck, m_fldToCompare); return listener; } /**