Interface PropertyValueDAO

All Known Implementing Classes:
AbstractPropertyValueDAOImpl, PropertyValueDAOImpl

public interface PropertyValueDAO
DAO services for alf_prop_XXX tables.
Since:
3.2
Author:
Derek Hulley
  • Method Details

    • getPropertyClassById

      Pair<Long,Class<?>> getPropertyClassById(Long id)
      FOR INTERNAL USE ONLY: Do not use directly; see interface comments.

      alf_prop_class accessor

      Parameters:
      id - the ID (may not be null)
    • getPropertyClass

      Pair<Long,Class<?>> getPropertyClass(Class<?> value)
      FOR INTERNAL USE ONLY: Do not use directly; see interface comments.

      alf_prop_class accessor

      Parameters:
      value - the value to find the ID for (may not be null)
    • getOrCreatePropertyClass

      Pair<Long,Class<?>> getOrCreatePropertyClass(Class<?> value)
      FOR INTERNAL USE ONLY: Do not use directly; see interface comments.

      alf_prop_class accessor

      Parameters:
      value - the value to find the ID for (may not be null)
    • getPropertyDateValueById

      Pair<Long,Date> getPropertyDateValueById(Long id)
      FOR INTERNAL USE ONLY: Do not use directly; see interface comments.

      alf_prop_date_value accessor

      Parameters:
      id - the ID (may not be null)
    • getPropertyDateValue

      Pair<Long,Date> getPropertyDateValue(Date value)
      FOR INTERNAL USE ONLY: Do not use directly; see interface comments.

      alf_prop_date_value accessor

      Parameters:
      value - the value to find the ID for (may not be null)
    • getOrCreatePropertyDateValue

      Pair<Long,Date> getOrCreatePropertyDateValue(Date value)
      FOR INTERNAL USE ONLY: Do not use directly; see interface comments.

      alf_prop_date_value accessor

      Parameters:
      value - the value to find the ID for (may not be null)
    • getPropertyStringCaseSensitiveSearchParameters

      Pair<String,Long> getPropertyStringCaseSensitiveSearchParameters(String value)
      Utility method to get query parameters for case-sensitive string searching
      See Also:
    • getPropertyStringValueById

      Pair<Long,String> getPropertyStringValueById(Long id)
      FOR INTERNAL USE ONLY: Do not use directly; see interface comments.

      alf_prop_string_value accessor

      Parameters:
      id - the ID (may not be null)
    • getPropertyStringValue

      Pair<Long,String> getPropertyStringValue(String value)
      FOR INTERNAL USE ONLY: Do not use directly; see interface comments.

      alf_prop_string_value accessor

      Parameters:
      value - the value to find the ID for (may not be null)
    • getOrCreatePropertyStringValue

      Pair<Long,String> getOrCreatePropertyStringValue(String value)
      FOR INTERNAL USE ONLY: Do not use directly; see interface comments.

      alf_prop_string_value accessor

      Parameters:
      value - the value to find the ID for (may not be null)
    • getPropertyDoubleValueById

      Pair<Long,Double> getPropertyDoubleValueById(Long id)
      FOR INTERNAL USE ONLY: Do not use directly; see interface comments.

      alf_prop_double_value accessor

      Parameters:
      id - the ID (may not be null)
    • getPropertyDoubleValue

      Pair<Long,Double> getPropertyDoubleValue(Double value)
      FOR INTERNAL USE ONLY: Do not use directly; see interface comments.

      alf_prop_double_value accessor

      Parameters:
      value - the value to find the ID for (may not be null)
    • getOrCreatePropertyDoubleValue

      Pair<Long,Double> getOrCreatePropertyDoubleValue(Double value)
      FOR INTERNAL USE ONLY: Do not use directly; see interface comments.

      alf_prop_double_value accessor

      Parameters:
      value - the value to find the ID for (may not be null)
    • getPropertySerializableValueById

      Pair<Long,Serializable> getPropertySerializableValueById(Long id)
      FOR INTERNAL USE ONLY: Do not use directly; see interface comments.

      alf_prop_serializable_value accessor

      Parameters:
      id - the ID (may not be null)
    • createPropertySerializableValue

      Pair<Long,Serializable> createPropertySerializableValue(Serializable value)
      FOR INTERNAL USE ONLY: Do not use directly; see interface comments.

      alf_prop_serializable_value accessor

      Parameters:
      value - the value to find the ID for (may not be null)
    • getPropertyValueById

      Pair<Long,Serializable> getPropertyValueById(Long id)
      Use for accessing unique properties; see interface comments.

      alf_prop_value accessor: get a property based on the database ID

      Parameters:
      id - the ID (may not be null)
    • getPropertyValue

      Pair<Long,Serializable> getPropertyValue(Serializable value)
      Use for accessing unique properties; see interface comments.

      alf_prop_value accessor: find a property based on the value

      Parameters:
      value - the value to find the ID for (may be null)
    • getOrCreatePropertyValue

      Pair<Long,Serializable> getOrCreatePropertyValue(Serializable value)
      Use for accessing unique properties; see interface comments.

      alf_prop_value accessor: find or create a property based on the value. Note: This method will not recurse into maps or collections. Use the dedicated methods if you want recursion; otherwise maps and collections will be serialized and probably stored as BLOB values.

      All collections and maps will be opened up to any depth.

      Parameters:
      value - the value to find the ID for (may be null)
    • getPropertyById

      Serializable getPropertyById(Long id)
      Use for accessing non-unique, exploded properties; see interface comments.

      alf_prop_root accessor: get a property based on the database ID

      Parameters:
      id - the ID (may not be null)
      Returns:
      Returns the value of the property (never null)
      Throws:
      org.springframework.dao.DataIntegrityViolationException - if the ID is invalid
    • getPropertiesByIds

      void getPropertiesByIds(List<Long> ids, PropertyValueDAO.PropertyFinderCallback callback)
      Use for accessing non-unique, exploded properties; see interface comments.

      alf_prop_root accessor: get all properties based on the database IDs

      Parameters:
      ids - the IDs (may not be null; may be empty)
      callback - the callback to handle the results
      Throws:
      org.springframework.dao.DataIntegrityViolationException - if any of the the IDs are invalid
    • createProperty

      Long createProperty(Serializable value)
      Use for accessing non-unique, exploded properties; see interface comments.

      alf_prop_root accessor: find or create a property based on the value.

      All collections and maps will be opened up to any depth.

      Parameters:
      value - the value to create (may be null)
      Returns:
      Returns the new property's ID
    • updateProperty

      void updateProperty(Long id, Serializable value)
      Use for accessing non-unique, exploded properties; see interface comments.

      alf_prop_root accessor: update the property root to contain a new value.

      Parameters:
      id - the ID of the root property to change
      value - the new property value
    • deleteProperty

      void deleteProperty(Long id)
      Use for accessing non-unique, exploded properties; see interface comments.

      alf_prop_root accessor: delete a property root completely

      Parameters:
      id - the ID of the root property to delete
    • createPropertyUniqueContext

      Pair<Long,Long> createPropertyUniqueContext(Serializable value1, Serializable value2, Serializable value3, Serializable propertyValue1)
      alf_prop_unique_ctx accessor: create a unique context with an optional associated value.

      The DAO ensures that the region-context-value combination will be globally unique.

      Parameters:
      value1 - a simple key value (not a collection) (may be null)
      value2 - a simple key value (not a collection) (may be null)
      value3 - a simple key value (not a collection) (may be null)
      propertyValue1 - a value to store against the key (may be null)
      Returns:
      Returns the ID-valueId pair of the context
      Throws:
      PropertyUniqueConstraintViolation - if the combination is not unique
    • getPropertyUniqueContext

      Pair<Long,Long> getPropertyUniqueContext(Serializable value1, Serializable value2, Serializable value3)
      Get the unique context ID and associated shared property ID, or null if no such context exists. The associated property may be null even if the unique context exists.
      Parameters:
      value1 - first value
      value2 - second value
      value3 - third value
      Returns:
      Returns the ID-valueId pair or null if the context doesn't exist.
      See Also:
    • getPropertyUniqueContext

      void getPropertyUniqueContext(PropertyValueDAO.PropertyUniqueContextCallback callback, Serializable... values)
      Get unique contexts (unique context ID and associated shared property ID), if any, based on one, two or three context values. The associated property may be null even if the unique context exists.
      Parameters:
      values - a combination of one to three values in order
      See Also:
    • updatePropertyUniqueContextKeys

      void updatePropertyUniqueContextKeys(Long id, Serializable value1, Serializable value2, Serializable value3)
      Update the unique context, preserving any associated property.
      Throws:
      PropertyUniqueConstraintViolation - if the combination is not unique
      See Also:
    • updatePropertyUniqueContext

      void updatePropertyUniqueContext(Serializable value1, Serializable value2, Serializable value3, Serializable propertyValue)
      Update the property associated with a unique context (based on one, two or three context values).
      See Also:
    • deletePropertyUniqueContext

      void deletePropertyUniqueContext(Long id)
      See Also:
    • deletePropertyUniqueContext

      int deletePropertyUniqueContext(Serializable... values)
      Delete sets of unique contexts based on one, two or three context values.
      Parameters:
      values - a combination of one to three values in order
      Returns:
      Returns the number of unique contexts deleted
    • convertPropertyIdSearchRows

      Serializable convertPropertyIdSearchRows(List<PropertyIdSearchRow> rows)
      Utility method to convert property query results into the original value. Note that the rows must all share the same root property ID.

      If the rows passed in don't constitute a valid, full property - they don't contain all the link entities for the property - then the result may be null.

      Parameters:
      rows - the search results for a single root property
      Returns:
      Returns the root property as originally persisted, or null if the rows don't represent a complete property
      Throws:
      IllegalArgumentException - if rows don't all share the same root property ID
    • cleanupUnusedValues

      void cleanupUnusedValues()
      Remove orphaned properties.
    • cleanupUnusedValuesV2

      void cleanupUnusedValuesV2()
    • cleanupUnusedValuesV3

      void cleanupUnusedValuesV3()