Interface MapLookupPojo<POJO extends MapLookupPojo>

Type Parameters:
POJO - the POJO class implementing MapLookupPojo
All Superinterfaces:
DbPojo
All Known Implementing Classes:
HostVulnerabilityOutput, License, Plugin, PluginHost, RemediationDetails, ScanHistory, ScanHost, ScanPlugin, ScanRemediation, ScanResponse.MultiChildLookup, ScanResponse.SingleChildLookup, SeverityBase, SeverityLevelCount, Vulnerability

@MappedSuperclass
public interface MapLookupPojo<POJO extends MapLookupPojo>
extends DbPojo
A "complex lookup" or "object lookup" altnerative to the HashLookupPojo interface Rather than using a hash of the object, this approach using a search map instead. This pojo type is often (though not always) used for records that are NOT immutable but have a composite candidate key (e.g. ScanHost, with a host_id and scan_id). It may also be used for immutable object lookups in place of a hash lookup when the pojo has a very simple object structure, so the overhead of calculating a hash (which also means serializing the object to obtain the string to be hashed... arguably the more expensive operation) may not be worth the indexing benefit it provides
  • Method Summary

    Modifier and Type Method Description
    java.util.Map<java.lang.String,​java.lang.Object> _getSearchMap()
    Return a map to be used by the POJO type's dao, to find the database record matching the same record that this pojo represents
    boolean _match​(POJO other)
    Determine if this pojo represents the same DB record as another POJO of the same type.
    void _set​(POJO other)
    Set the values in this POJO to be identical to another POJO representing the same DB record

    Methods inherited from interface tenapull.data.entity.template.DbPojo

    _prepare, getId, setId, toJsonNode, toJsonString
  • Method Details

    • _set

      void _set​(POJO other)
      Set the values in this POJO to be identical to another POJO representing the same DB record
      Parameters:
      other -
    • _match

      boolean _match​(POJO other)
      Determine if this pojo represents the same DB record as another POJO of the same type. Note that this is NOT the same as the equals() method (though it may be in certain cases). Equals may be used to determine if two pojos of the same type contain all of the same values, regardless of whether they represent the same DB record (depending on implementation) while _match determines only if they represent the same DB record even if some of the values may not be equivalent. In many cases the two methods may be the same, but their purpose is different.
      Parameters:
      other - the other pojo to match
      Returns:
      true if the two pojos represent the same DB record, false if not
    • _getSearchMap

      java.util.Map<java.lang.String,​java.lang.Object> _getSearchMap()
      Return a map to be used by the POJO type's dao, to find the database record matching the same record that this pojo represents
      Returns: