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

Nested Class Summary
static interface PropertyValueDAO.PropertyFinderCallback
          A callback for handling return properties
static interface PropertyValueDAO.PropertyUniqueContextCallback
          A callback for handling return property unique contexts
 
Method Summary
 java.io.Serializable convertPropertyIdSearchRows(java.util.List rows)
          Utility method to convert property query results into the original value.
 java.lang.Long createProperty(java.io.Serializable value)
          Use for accessing non-unique, exploded properties; see interface comments.
 org.alfresco.util.Pair createPropertySerializableValue(java.io.Serializable value)
          FOR INTERNAL USE ONLY: Do not use directly; see interface comments.
 org.alfresco.util.Pair 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.
 void deleteProperty(java.lang.Long id)
          Use for accessing non-unique, exploded properties; see interface comments.
 void deletePropertyUniqueContext(java.lang.Long id)
           
 int deletePropertyUniqueContext(java.io.Serializable[] values)
          Delete sets of unique contexts based on one, two or three context values.
 org.alfresco.util.Pair getOrCreatePropertyClass(java.lang.Class value)
          FOR INTERNAL USE ONLY: Do not use directly; see interface comments.
 org.alfresco.util.Pair getOrCreatePropertyDateValue(java.util.Date value)
          FOR INTERNAL USE ONLY: Do not use directly; see interface comments.
 org.alfresco.util.Pair getOrCreatePropertyDoubleValue(java.lang.Double value)
          FOR INTERNAL USE ONLY: Do not use directly; see interface comments.
 org.alfresco.util.Pair getOrCreatePropertyStringValue(java.lang.String value)
          FOR INTERNAL USE ONLY: Do not use directly; see interface comments.
 org.alfresco.util.Pair getOrCreatePropertyValue(java.io.Serializable value)
          Use for accessing unique properties; see interface comments.
 void getPropertiesByIds(java.util.List ids, PropertyValueDAO.PropertyFinderCallback callback)
          Use for accessing non-unique, exploded properties; see interface comments.
 java.io.Serializable getPropertyById(java.lang.Long id)
          Use for accessing non-unique, exploded properties; see interface comments.
 org.alfresco.util.Pair getPropertyClass(java.lang.Class value)
          FOR INTERNAL USE ONLY: Do not use directly; see interface comments.
 org.alfresco.util.Pair getPropertyClassById(java.lang.Long id)
          FOR INTERNAL USE ONLY: Do not use directly; see interface comments.
 org.alfresco.util.Pair getPropertyDateValue(java.util.Date value)
          FOR INTERNAL USE ONLY: Do not use directly; see interface comments.
 org.alfresco.util.Pair getPropertyDateValueById(java.lang.Long id)
          FOR INTERNAL USE ONLY: Do not use directly; see interface comments.
 org.alfresco.util.Pair getPropertyDoubleValue(java.lang.Double value)
          FOR INTERNAL USE ONLY: Do not use directly; see interface comments.
 org.alfresco.util.Pair getPropertyDoubleValueById(java.lang.Long id)
          FOR INTERNAL USE ONLY: Do not use directly; see interface comments.
 org.alfresco.util.Pair getPropertySerializableValueById(java.lang.Long id)
          FOR INTERNAL USE ONLY: Do not use directly; see interface comments.
 org.alfresco.util.Pair getPropertyStringCaseSensitiveSearchParameters(java.lang.String value)
          Utility method to get query parameters for case-sensitive string searching
 org.alfresco.util.Pair getPropertyStringValue(java.lang.String value)
          FOR INTERNAL USE ONLY: Do not use directly; see interface comments.
 org.alfresco.util.Pair getPropertyStringValueById(java.lang.Long id)
          FOR INTERNAL USE ONLY: Do not use directly; see interface comments.
 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.
 org.alfresco.util.Pair 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.
 org.alfresco.util.Pair getPropertyValue(java.io.Serializable value)
          Use for accessing unique properties; see interface comments.
 org.alfresco.util.Pair getPropertyValueById(java.lang.Long id)
          Use for accessing unique properties; see interface comments.
 void updateProperty(java.lang.Long id, java.io.Serializable value)
          Use for accessing non-unique, exploded properties; see interface comments.
 void updatePropertyUniqueContext(java.lang.Long id, java.io.Serializable propertyValue1)
          Update the property associated with a unique context.
 void updatePropertyUniqueContext(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 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 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 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 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 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 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 getPropertyStringCaseSensitiveSearchParameters(java.lang.String value)
Utility method to get query parameters for case-sensitive string searching

See Also:
CrcHelper

getPropertyStringValueById

org.alfresco.util.Pair 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 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 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 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 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 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 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 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 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 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 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. To limit this behaviour, use #getOrCreatePropertyValue(Serializable, int).

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 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 change
value - 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 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 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:
values - a combination of one to three values in order
Returns:
Returns the ID-valueId pair or null if the context doesn't exist.
See Also:
PropertyValueDAO.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:
PropertyValueDAO.createPropertyUniqueContext(Serializable, Serializable, Serializable, Serializable)

updatePropertyUniqueContext

void updatePropertyUniqueContext(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:
PropertyValueDAO.createPropertyUniqueContext(Serializable, Serializable, Serializable, Serializable)

updatePropertyUniqueContext

void updatePropertyUniqueContext(java.lang.Long id,
                                 java.io.Serializable propertyValue1)
Update the property associated with a unique context.

See Also:
PropertyValueDAO.createPropertyUniqueContext(Serializable, Serializable, Serializable, Serializable)

deletePropertyUniqueContext

void deletePropertyUniqueContext(java.lang.Long id)
See Also:
PropertyValueDAO.createPropertyUniqueContext(Serializable, Serializable, Serializable, Serializable)

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 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


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.