Package org.alfresco.repo.domain.propval
Interface PropertyValueDAO
- All Known Implementing Classes:
AbstractPropertyValueDAOImpl,PropertyValueDAOImpl
public interface PropertyValueDAO
DAO services for alf_prop_XXX tables.
- Since:
- 3.2
- Author:
- Derek Hulley
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA callback for handling return propertiesstatic interfaceA callback for handling return property unique contexts -
Method Summary
Modifier and TypeMethodDescriptionvoidRemove orphaned properties.voidvoidUtility method to convert property query results into the original value.createProperty(Serializable value) Use for accessing non-unique, exploded properties; see interface comments.FOR INTERNAL USE ONLY: Do not use directly; see interface comments.createPropertyUniqueContext(Serializable value1, Serializable value2, Serializable value3, Serializable propertyValue1) alf_prop_unique_ctx accessor: create a unique context with an optional associated value.voiddeleteProperty(Long id) Use for accessing non-unique, exploded properties; see interface comments.intdeletePropertyUniqueContext(Serializable... values) Delete sets of unique contexts based on one, two or three context values.voidgetOrCreatePropertyClass(Class<?> value) FOR INTERNAL USE ONLY: Do not use directly; see interface comments.getOrCreatePropertyDateValue(Date value) FOR INTERNAL USE ONLY: Do not use directly; see interface comments.FOR INTERNAL USE ONLY: Do not use directly; see interface comments.FOR INTERNAL USE ONLY: Do not use directly; see interface comments.Use for accessing unique properties; see interface comments.voidgetPropertiesByIds(List<Long> ids, PropertyValueDAO.PropertyFinderCallback callback) Use for accessing non-unique, exploded properties; see interface comments.getPropertyById(Long id) Use for accessing non-unique, exploded properties; see interface comments.getPropertyClass(Class<?> value) FOR INTERNAL USE ONLY: Do not use directly; see interface comments.FOR INTERNAL USE ONLY: Do not use directly; see interface comments.getPropertyDateValue(Date value) FOR INTERNAL USE ONLY: Do not use directly; see interface comments.FOR INTERNAL USE ONLY: Do not use directly; see interface comments.getPropertyDoubleValue(Double value) FOR INTERNAL USE ONLY: Do not use directly; see interface comments.FOR INTERNAL USE ONLY: Do not use directly; see interface comments.FOR INTERNAL USE ONLY: Do not use directly; see interface comments.Utility method to get query parameters for case-sensitive string searchinggetPropertyStringValue(String value) FOR INTERNAL USE ONLY: Do not use directly; see interface comments.FOR INTERNAL USE ONLY: Do not use directly; see interface comments.getPropertyUniqueContext(Serializable value1, Serializable value2, Serializable value3) Get the unique context ID and associated shared property ID, or null if no such context exists.voidgetPropertyUniqueContext(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.getPropertyValue(Serializable value) Use for accessing unique properties; see interface comments.Use for accessing unique properties; see interface comments.voidupdateProperty(Long id, Serializable value) Use for accessing non-unique, exploded properties; see interface comments.voidupdatePropertyUniqueContext(Serializable value1, Serializable value2, Serializable value3, Serializable propertyValue) Update the property associated with a unique context (based on one, two or three context values).voidupdatePropertyUniqueContextKeys(Long id, Serializable value1, Serializable value2, Serializable value3) Update the unique context, preserving any associated property.
-
Method Details
-
getPropertyClassById
FOR INTERNAL USE ONLY: Do not use directly; see interface comments. alf_prop_class accessor- Parameters:
id- the ID (may not be null)
-
getPropertyClass
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
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
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
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
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
Utility method to get query parameters for case-sensitive string searching- See Also:
-
getPropertyStringValueById
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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 changevalue- the new property value
-
deleteProperty
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 valuevalue2- second valuevalue3- 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). -
deletePropertyUniqueContext
-
deletePropertyUniqueContext
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
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()
-