Package org.alfresco.repo.domain.propval
Interface PropertyValueDAO
-
- All Known Implementing Classes:
AbstractPropertyValueDAOImpl,PropertyValueDAOImpl
public interface PropertyValueDAODAO services for alf_prop_XXX tables.- Since:
- 3.2
- Author:
- Derek Hulley
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfacePropertyValueDAO.PropertyFinderCallbackA callback for handling return propertiesstatic interfacePropertyValueDAO.PropertyUniqueContextCallbackA callback for handling return property unique contexts
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcleanupUnusedValues()Remove orphaned properties.java.io.SerializableconvertPropertyIdSearchRows(java.util.List<PropertyIdSearchRow> rows)Utility method to convert property query results into the original value.java.lang.LongcreateProperty(java.io.Serializable value)Use for accessing non-unique, exploded properties; see interface comments.org.alfresco.util.Pair<java.lang.Long,java.io.Serializable>createPropertySerializableValue(java.io.Serializable value)FOR INTERNAL USE ONLY: Do not use directly; see interface comments.org.alfresco.util.Pair<java.lang.Long,java.lang.Long>createPropertyUniqueContext(java.io.Serializable value1, java.io.Serializable value2, java.io.Serializable value3, java.io.Serializable propertyValue1)alf_prop_unique_ctx accessor: create a unique context with an optional associated value.voiddeleteProperty(java.lang.Long id)Use for accessing non-unique, exploded properties; see interface comments.intdeletePropertyUniqueContext(java.io.Serializable... values)Delete sets of unique contexts based on one, two or three context values.voiddeletePropertyUniqueContext(java.lang.Long id)org.alfresco.util.Pair<java.lang.Long,java.lang.Class<?>>getOrCreatePropertyClass(java.lang.Class<?> value)FOR INTERNAL USE ONLY: Do not use directly; see interface comments.org.alfresco.util.Pair<java.lang.Long,java.util.Date>getOrCreatePropertyDateValue(java.util.Date value)FOR INTERNAL USE ONLY: Do not use directly; see interface comments.org.alfresco.util.Pair<java.lang.Long,java.lang.Double>getOrCreatePropertyDoubleValue(java.lang.Double value)FOR INTERNAL USE ONLY: Do not use directly; see interface comments.org.alfresco.util.Pair<java.lang.Long,java.lang.String>getOrCreatePropertyStringValue(java.lang.String value)FOR INTERNAL USE ONLY: Do not use directly; see interface comments.org.alfresco.util.Pair<java.lang.Long,java.io.Serializable>getOrCreatePropertyValue(java.io.Serializable value)Use for accessing unique properties; see interface comments.voidgetPropertiesByIds(java.util.List<java.lang.Long> ids, PropertyValueDAO.PropertyFinderCallback callback)Use for accessing non-unique, exploded properties; see interface comments.java.io.SerializablegetPropertyById(java.lang.Long id)Use for accessing non-unique, exploded properties; see interface comments.org.alfresco.util.Pair<java.lang.Long,java.lang.Class<?>>getPropertyClass(java.lang.Class<?> value)FOR INTERNAL USE ONLY: Do not use directly; see interface comments.org.alfresco.util.Pair<java.lang.Long,java.lang.Class<?>>getPropertyClassById(java.lang.Long id)FOR INTERNAL USE ONLY: Do not use directly; see interface comments.org.alfresco.util.Pair<java.lang.Long,java.util.Date>getPropertyDateValue(java.util.Date value)FOR INTERNAL USE ONLY: Do not use directly; see interface comments.org.alfresco.util.Pair<java.lang.Long,java.util.Date>getPropertyDateValueById(java.lang.Long id)FOR INTERNAL USE ONLY: Do not use directly; see interface comments.org.alfresco.util.Pair<java.lang.Long,java.lang.Double>getPropertyDoubleValue(java.lang.Double value)FOR INTERNAL USE ONLY: Do not use directly; see interface comments.org.alfresco.util.Pair<java.lang.Long,java.lang.Double>getPropertyDoubleValueById(java.lang.Long id)FOR INTERNAL USE ONLY: Do not use directly; see interface comments.org.alfresco.util.Pair<java.lang.Long,java.io.Serializable>getPropertySerializableValueById(java.lang.Long id)FOR INTERNAL USE ONLY: Do not use directly; see interface comments.org.alfresco.util.Pair<java.lang.String,java.lang.Long>getPropertyStringCaseSensitiveSearchParameters(java.lang.String value)Utility method to get query parameters for case-sensitive string searchingorg.alfresco.util.Pair<java.lang.Long,java.lang.String>getPropertyStringValue(java.lang.String value)FOR INTERNAL USE ONLY: Do not use directly; see interface comments.org.alfresco.util.Pair<java.lang.Long,java.lang.String>getPropertyStringValueById(java.lang.Long id)FOR INTERNAL USE ONLY: Do not use directly; see interface comments.org.alfresco.util.Pair<java.lang.Long,java.lang.Long>getPropertyUniqueContext(java.io.Serializable value1, java.io.Serializable value2, java.io.Serializable value3)Get the unique context ID and associated shared property ID, or null if no such context exists.voidgetPropertyUniqueContext(PropertyValueDAO.PropertyUniqueContextCallback callback, java.io.Serializable... values)Get unique contexts (unique context ID and associated shared property ID), if any, based on one, two or three context values.org.alfresco.util.Pair<java.lang.Long,java.io.Serializable>getPropertyValue(java.io.Serializable value)Use for accessing unique properties; see interface comments.org.alfresco.util.Pair<java.lang.Long,java.io.Serializable>getPropertyValueById(java.lang.Long id)Use for accessing unique properties; see interface comments.voidupdateProperty(java.lang.Long id, java.io.Serializable value)Use for accessing non-unique, exploded properties; see interface comments.voidupdatePropertyUniqueContext(java.io.Serializable value1, java.io.Serializable value2, java.io.Serializable value3, java.io.Serializable propertyValue)Update the property associated with a unique context (based on one, two or three context values).voidupdatePropertyUniqueContextKeys(java.lang.Long id, java.io.Serializable value1, java.io.Serializable value2, java.io.Serializable value3)Update the unique context, preserving any associated property.
-
-
-
Method Detail
-
getPropertyClassById
org.alfresco.util.Pair<java.lang.Long,java.lang.Class<?>> getPropertyClassById(java.lang.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
org.alfresco.util.Pair<java.lang.Long,java.lang.Class<?>> getPropertyClass(java.lang.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
org.alfresco.util.Pair<java.lang.Long,java.lang.Class<?>> getOrCreatePropertyClass(java.lang.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
org.alfresco.util.Pair<java.lang.Long,java.util.Date> getPropertyDateValueById(java.lang.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
org.alfresco.util.Pair<java.lang.Long,java.util.Date> getPropertyDateValue(java.util.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
org.alfresco.util.Pair<java.lang.Long,java.util.Date> getOrCreatePropertyDateValue(java.util.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
org.alfresco.util.Pair<java.lang.String,java.lang.Long> getPropertyStringCaseSensitiveSearchParameters(java.lang.String value)
Utility method to get query parameters for case-sensitive string searching- See Also:
CrcHelper
-
getPropertyStringValueById
org.alfresco.util.Pair<java.lang.Long,java.lang.String> getPropertyStringValueById(java.lang.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
org.alfresco.util.Pair<java.lang.Long,java.lang.String> getPropertyStringValue(java.lang.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
org.alfresco.util.Pair<java.lang.Long,java.lang.String> getOrCreatePropertyStringValue(java.lang.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
org.alfresco.util.Pair<java.lang.Long,java.lang.Double> getPropertyDoubleValueById(java.lang.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
org.alfresco.util.Pair<java.lang.Long,java.lang.Double> getPropertyDoubleValue(java.lang.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
org.alfresco.util.Pair<java.lang.Long,java.lang.Double> getOrCreatePropertyDoubleValue(java.lang.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
org.alfresco.util.Pair<java.lang.Long,java.io.Serializable> getPropertySerializableValueById(java.lang.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
org.alfresco.util.Pair<java.lang.Long,java.io.Serializable> createPropertySerializableValue(java.io.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
org.alfresco.util.Pair<java.lang.Long,java.io.Serializable> getPropertyValueById(java.lang.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
org.alfresco.util.Pair<java.lang.Long,java.io.Serializable> getPropertyValue(java.io.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
org.alfresco.util.Pair<java.lang.Long,java.io.Serializable> getOrCreatePropertyValue(java.io.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
java.io.Serializable getPropertyById(java.lang.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(java.util.List<java.lang.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
java.lang.Long createProperty(java.io.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(java.lang.Long id, java.io.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 changevalue- the new property value
-
deleteProperty
void deleteProperty(java.lang.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
org.alfresco.util.Pair<java.lang.Long,java.lang.Long> createPropertyUniqueContext(java.io.Serializable value1, java.io.Serializable value2, java.io.Serializable value3, java.io.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
org.alfresco.util.Pair<java.lang.Long,java.lang.Long> getPropertyUniqueContext(java.io.Serializable value1, java.io.Serializable value2, java.io.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:
createPropertyUniqueContext(Serializable, Serializable, Serializable, Serializable)
-
getPropertyUniqueContext
void getPropertyUniqueContext(PropertyValueDAO.PropertyUniqueContextCallback callback, java.io.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:
createPropertyUniqueContext(Serializable, Serializable, Serializable, Serializable)
-
updatePropertyUniqueContextKeys
void updatePropertyUniqueContextKeys(java.lang.Long id, java.io.Serializable value1, java.io.Serializable value2, java.io.Serializable value3)Update the unique context, preserving any associated property.- Throws:
PropertyUniqueConstraintViolation- if the combination is not unique- See Also:
createPropertyUniqueContext(Serializable, Serializable, Serializable, Serializable)
-
updatePropertyUniqueContext
void updatePropertyUniqueContext(java.io.Serializable value1, java.io.Serializable value2, java.io.Serializable value3, java.io.Serializable propertyValue)Update the property associated with a unique context (based on one, two or three context values).
-
deletePropertyUniqueContext
void deletePropertyUniqueContext(java.lang.Long id)
-
deletePropertyUniqueContext
int deletePropertyUniqueContext(java.io.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
java.io.Serializable convertPropertyIdSearchRows(java.util.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:
java.lang.IllegalArgumentException- if rows don't all share the same root property ID
-
cleanupUnusedValues
void cleanupUnusedValues()
Remove orphaned properties.
-
-