org.alfresco.repo.domain.propval
Class AbstractPropertyValueDAOImpl

java.lang.Object
  extended by org.alfresco.repo.domain.propval.AbstractPropertyValueDAOImpl
All Implemented Interfaces:
PropertyValueDAO
Direct Known Subclasses:
PropertyValueDAOImpl

public abstract class AbstractPropertyValueDAOImpl
extends java.lang.Object
implements PropertyValueDAO

Abstract implementation for Property Value DAO.

This provides basic services such as caching, but defers to the underlying implementation for CRUD operations.

Since:
3.2

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.alfresco.repo.domain.propval.PropertyValueDAO
PropertyValueDAO.PropertyFinderCallback, PropertyValueDAO.PropertyUniqueContextCallback
 
Field Summary
protected  ControlDAO controlDAO
           
protected  PropertyTypeConverter converter
           
protected  org.apache.commons.logging.Log logger
           
 
Constructor Summary
AbstractPropertyValueDAOImpl()
          Default constructor.
 
Method Summary
protected  java.io.Serializable constructEmptyContainer(java.lang.Class clazz)
          Returns a reconstructable instance
 java.io.Serializable convertPropertyIdSearchRows(java.util.List rows)
          Utility method to convert property query results into the original value.
protected abstract  PropertyClassEntity createClass(java.lang.Class value)
           
protected abstract  PropertyDateValueEntity createDateValue(java.util.Date value)
           
protected abstract  PropertyDoubleValueEntity createDoubleValue(java.lang.Double value)
           
 java.lang.Long createProperty(java.io.Serializable value)
          Use for accessing non-unique, exploded properties; see interface comments.
protected abstract  void createPropertyLink(java.lang.Long rootPropId, java.lang.Long propIndex, java.lang.Long containedIn, java.lang.Long keyPropId, java.lang.Long valuePropId)
          Create an entry for the map or collection link.
protected abstract  java.lang.Long createPropertyRoot()
           
 org.alfresco.util.Pair createPropertySerializableValue(java.io.Serializable value)
          FOR INTERNAL USE ONLY: Do not use directly; see interface comments.
protected abstract  PropertyUniqueContextEntity createPropertyUniqueContext(java.lang.Long valueId1, java.lang.Long valueId2, java.lang.Long valueId3, java.lang.Long propertyId)
           
 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.
protected abstract  PropertyValueEntity createPropertyValue(java.io.Serializable value)
           
protected abstract  PropertySerializableValueEntity createSerializableValue(java.io.Serializable value)
           
protected abstract  java.lang.Long createStringValue(java.lang.String value)
           
 void deleteProperty(java.lang.Long id)
          Use for accessing non-unique, exploded properties; see interface comments.
protected abstract  int deletePropertyLinks(java.lang.Long rootPropId)
          Remove all property links for a given property root.
protected abstract  void deletePropertyRoot(java.lang.Long id)
           
 int deletePropertyUniqueContext(java.io.Serializable[] values)
          Delete sets of unique contexts based on one, two or three context values.
protected abstract  int deletePropertyUniqueContexts(java.lang.Long[] valueIds)
           
protected abstract  PropertyClassEntity findClassById(java.lang.Long id)
           
protected abstract  PropertyClassEntity findClassByValue(java.lang.Class value)
           
protected abstract  PropertyDateValueEntity findDateValueById(java.lang.Long id)
           
protected abstract  PropertyDateValueEntity findDateValueByValue(java.util.Date value)
           
protected abstract  PropertyDoubleValueEntity findDoubleValueById(java.lang.Long id)
           
protected abstract  PropertyDoubleValueEntity findDoubleValueByValue(java.lang.Double value)
           
protected abstract  void findPropertiesByIds(java.util.List ids, PropertyValueDAO.PropertyFinderCallback callback)
           
protected abstract  java.util.List findPropertyById(java.lang.Long id)
           
protected abstract  PropertyValueEntity findPropertyValueById(java.lang.Long id)
           
protected abstract  PropertyValueEntity findPropertyValueByValue(java.io.Serializable value)
           
protected abstract  PropertySerializableValueEntity findSerializableValueById(java.lang.Long id)
           
protected abstract  java.lang.String findStringValueById(java.lang.Long id)
           
protected abstract  java.lang.Long findStringValueByValue(java.lang.String value)
           
 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.
protected abstract  PropertyRootEntity getPropertyRoot(java.lang.Long id)
           
 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.
protected abstract  PropertyUniqueContextEntity getPropertyUniqueContextById(java.lang.Long id)
           
protected abstract  PropertyUniqueContextEntity getPropertyUniqueContextByValues(java.lang.Long valueId1, java.lang.Long valueId2, java.lang.Long valueId3)
           
protected abstract  void getPropertyUniqueContextByValues(PropertyValueDAO.PropertyUniqueContextCallback callback, java.lang.Long[] valueIds)
           
 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 setControlDAO(ControlDAO controlDAO)
           
 void setConverter(PropertyTypeConverter converter)
           
 void setPropertyCache(org.alfresco.repo.cache.SimpleCache propertyCache)
          Set the cache to use for alf_prop_root lookups (optional).
 void setPropertyClassCache(org.alfresco.repo.cache.SimpleCache propertyClassCache)
          Set the cache to use for alf_prop_class lookups (optional).
 void setPropertyDateValueCache(org.alfresco.repo.cache.SimpleCache propertyDateValueCache)
          Set the cache to use for alf_prop_date_value lookups (optional).
 void setPropertyDoubleValueCache(org.alfresco.repo.cache.SimpleCache propertyDoubleValueCache)
          Set the cache to use for alf_prop_double_value lookups (optional).
 void setPropertySerializableValueCache(org.alfresco.repo.cache.SimpleCache propertySerializableValueCache)
          Set the cache to use for alf_prop_serializable_value lookups (optional).
 void setPropertyStringValueCache(org.alfresco.repo.cache.SimpleCache propertyStringValueCache)
          Set the cache to use for alf_prop_string_value lookups (optional).
 void setPropertyValueCache(org.alfresco.repo.cache.SimpleCache propertyValueCache)
          Set the cache to use for alf_prop_value lookups (optional).
 void updateProperty(java.lang.Long rootPropId, java.io.Serializable value)
          Use for accessing non-unique, exploded properties; see interface comments.
protected abstract  PropertyRootEntity updatePropertyRoot(PropertyRootEntity entity)
           
 void updatePropertyUniqueContext(java.lang.Long id, java.io.Serializable propertyValue)
          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.
protected abstract  PropertyUniqueContextEntity updatePropertyUniqueContext(PropertyUniqueContextEntity entity)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.alfresco.repo.domain.propval.PropertyValueDAO
deletePropertyUniqueContext
 

Field Detail

logger

protected final org.apache.commons.logging.Log logger

converter

protected PropertyTypeConverter converter

controlDAO

protected ControlDAO controlDAO
Constructor Detail

AbstractPropertyValueDAOImpl

public AbstractPropertyValueDAOImpl()
Default constructor.

This sets up the DAO accessors to bypass any caching to handle the case where the caches are not supplied in the setters.

Method Detail

setConverter

public void setConverter(PropertyTypeConverter converter)
Parameters:
converter - the converter that translates between external and persisted values

setControlDAO

public void setControlDAO(ControlDAO controlDAO)
Parameters:
controlDAO - the DAO that provides connection control

setPropertyClassCache

public void setPropertyClassCache(org.alfresco.repo.cache.SimpleCache propertyClassCache)
Set the cache to use for alf_prop_class lookups (optional).

Parameters:
propertyClassCache - the cache of IDs to property classes

setPropertyDateValueCache

public void setPropertyDateValueCache(org.alfresco.repo.cache.SimpleCache propertyDateValueCache)
Set the cache to use for alf_prop_date_value lookups (optional).

Parameters:
propertyDateValueCache - the cache of IDs to property values

setPropertyStringValueCache

public void setPropertyStringValueCache(org.alfresco.repo.cache.SimpleCache propertyStringValueCache)
Set the cache to use for alf_prop_string_value lookups (optional).

Parameters:
propertyStringValueCache - the cache of IDs to property string values

setPropertyDoubleValueCache

public void setPropertyDoubleValueCache(org.alfresco.repo.cache.SimpleCache propertyDoubleValueCache)
Set the cache to use for alf_prop_double_value lookups (optional).

Parameters:
propertyDoubleValueCache - the cache of IDs to property values

setPropertySerializableValueCache

public void setPropertySerializableValueCache(org.alfresco.repo.cache.SimpleCache propertySerializableValueCache)
Set the cache to use for alf_prop_serializable_value lookups (optional).

Parameters:
propertySerializableValueCache - the cache of IDs to property values

setPropertyValueCache

public void setPropertyValueCache(org.alfresco.repo.cache.SimpleCache propertyValueCache)
Set the cache to use for alf_prop_value lookups (optional).

Parameters:
propertyValueCache - the cache of IDs to property values

setPropertyCache

public void setPropertyCache(org.alfresco.repo.cache.SimpleCache propertyCache)
Set the cache to use for alf_prop_root lookups (optional).

Parameters:
propertyValueCache - the cache of IDs to property values

getPropertyClassById

public org.alfresco.util.Pair getPropertyClassById(java.lang.Long id)
Description copied from interface: PropertyValueDAO
FOR INTERNAL USE ONLY: Do not use directly; see interface comments.

alf_prop_class accessor

Specified by:
getPropertyClassById in interface PropertyValueDAO
Parameters:
id - the ID (may not be null)

getPropertyClass

public org.alfresco.util.Pair getPropertyClass(java.lang.Class value)
Description copied from interface: PropertyValueDAO
FOR INTERNAL USE ONLY: Do not use directly; see interface comments.

alf_prop_class accessor

Specified by:
getPropertyClass in interface PropertyValueDAO
Parameters:
value - the value to find the ID for (may not be null)

getOrCreatePropertyClass

public org.alfresco.util.Pair getOrCreatePropertyClass(java.lang.Class value)
Description copied from interface: PropertyValueDAO
FOR INTERNAL USE ONLY: Do not use directly; see interface comments.

alf_prop_class accessor

Specified by:
getOrCreatePropertyClass in interface PropertyValueDAO
Parameters:
value - the value to find the ID for (may not be null)

findClassById

protected abstract PropertyClassEntity findClassById(java.lang.Long id)

findClassByValue

protected abstract PropertyClassEntity findClassByValue(java.lang.Class value)

createClass

protected abstract PropertyClassEntity createClass(java.lang.Class value)

getPropertyDateValueById

public org.alfresco.util.Pair getPropertyDateValueById(java.lang.Long id)
Description copied from interface: PropertyValueDAO
FOR INTERNAL USE ONLY: Do not use directly; see interface comments.

alf_prop_date_value accessor

Specified by:
getPropertyDateValueById in interface PropertyValueDAO
Parameters:
id - the ID (may not be null)

getPropertyDateValue

public org.alfresco.util.Pair getPropertyDateValue(java.util.Date value)
Description copied from interface: PropertyValueDAO
FOR INTERNAL USE ONLY: Do not use directly; see interface comments.

alf_prop_date_value accessor

Specified by:
getPropertyDateValue in interface PropertyValueDAO
Parameters:
value - the value to find the ID for (may not be null)

getOrCreatePropertyDateValue

public org.alfresco.util.Pair getOrCreatePropertyDateValue(java.util.Date value)
Description copied from interface: PropertyValueDAO
FOR INTERNAL USE ONLY: Do not use directly; see interface comments.

alf_prop_date_value accessor

Specified by:
getOrCreatePropertyDateValue in interface PropertyValueDAO
Parameters:
value - the value to find the ID for (may not be null)

findDateValueById

protected abstract PropertyDateValueEntity findDateValueById(java.lang.Long id)

findDateValueByValue

protected abstract PropertyDateValueEntity findDateValueByValue(java.util.Date value)
Parameters:
value - a date, accurate to the day

createDateValue

protected abstract PropertyDateValueEntity createDateValue(java.util.Date value)
Parameters:
value - a date, accurate to the day

getPropertyStringCaseSensitiveSearchParameters

public org.alfresco.util.Pair getPropertyStringCaseSensitiveSearchParameters(java.lang.String value)
Description copied from interface: PropertyValueDAO
Utility method to get query parameters for case-sensitive string searching

Specified by:
getPropertyStringCaseSensitiveSearchParameters in interface PropertyValueDAO
See Also:
CrcHelper

getPropertyStringValueById

public org.alfresco.util.Pair getPropertyStringValueById(java.lang.Long id)
Description copied from interface: PropertyValueDAO
FOR INTERNAL USE ONLY: Do not use directly; see interface comments.

alf_prop_string_value accessor

Specified by:
getPropertyStringValueById in interface PropertyValueDAO
Parameters:
id - the ID (may not be null)

getPropertyStringValue

public org.alfresco.util.Pair getPropertyStringValue(java.lang.String value)
Description copied from interface: PropertyValueDAO
FOR INTERNAL USE ONLY: Do not use directly; see interface comments.

alf_prop_string_value accessor

Specified by:
getPropertyStringValue in interface PropertyValueDAO
Parameters:
value - the value to find the ID for (may not be null)

getOrCreatePropertyStringValue

public org.alfresco.util.Pair getOrCreatePropertyStringValue(java.lang.String value)
Description copied from interface: PropertyValueDAO
FOR INTERNAL USE ONLY: Do not use directly; see interface comments.

alf_prop_string_value accessor

Specified by:
getOrCreatePropertyStringValue in interface PropertyValueDAO
Parameters:
value - the value to find the ID for (may not be null)

findStringValueById

protected abstract java.lang.String findStringValueById(java.lang.Long id)

findStringValueByValue

protected abstract java.lang.Long findStringValueByValue(java.lang.String value)

createStringValue

protected abstract java.lang.Long createStringValue(java.lang.String value)

getPropertyDoubleValueById

public org.alfresco.util.Pair getPropertyDoubleValueById(java.lang.Long id)
Description copied from interface: PropertyValueDAO
FOR INTERNAL USE ONLY: Do not use directly; see interface comments.

alf_prop_double_value accessor

Specified by:
getPropertyDoubleValueById in interface PropertyValueDAO
Parameters:
id - the ID (may not be null)

getPropertyDoubleValue

public org.alfresco.util.Pair getPropertyDoubleValue(java.lang.Double value)
Description copied from interface: PropertyValueDAO
FOR INTERNAL USE ONLY: Do not use directly; see interface comments.

alf_prop_double_value accessor

Specified by:
getPropertyDoubleValue in interface PropertyValueDAO
Parameters:
value - the value to find the ID for (may not be null)

getOrCreatePropertyDoubleValue

public org.alfresco.util.Pair getOrCreatePropertyDoubleValue(java.lang.Double value)
Description copied from interface: PropertyValueDAO
FOR INTERNAL USE ONLY: Do not use directly; see interface comments.

alf_prop_double_value accessor

Specified by:
getOrCreatePropertyDoubleValue in interface PropertyValueDAO
Parameters:
value - the value to find the ID for (may not be null)

findDoubleValueById

protected abstract PropertyDoubleValueEntity findDoubleValueById(java.lang.Long id)

findDoubleValueByValue

protected abstract PropertyDoubleValueEntity findDoubleValueByValue(java.lang.Double value)

createDoubleValue

protected abstract PropertyDoubleValueEntity createDoubleValue(java.lang.Double value)

getPropertySerializableValueById

public org.alfresco.util.Pair getPropertySerializableValueById(java.lang.Long id)
Description copied from interface: PropertyValueDAO
FOR INTERNAL USE ONLY: Do not use directly; see interface comments.

alf_prop_serializable_value accessor

Specified by:
getPropertySerializableValueById in interface PropertyValueDAO
Parameters:
id - the ID (may not be null)

createPropertySerializableValue

public org.alfresco.util.Pair createPropertySerializableValue(java.io.Serializable value)
Description copied from interface: PropertyValueDAO
FOR INTERNAL USE ONLY: Do not use directly; see interface comments.

alf_prop_serializable_value accessor

Specified by:
createPropertySerializableValue in interface PropertyValueDAO
Parameters:
value - the value to find the ID for (may not be null)

findSerializableValueById

protected abstract PropertySerializableValueEntity findSerializableValueById(java.lang.Long id)

createSerializableValue

protected abstract PropertySerializableValueEntity createSerializableValue(java.io.Serializable value)

getPropertyValueById

public org.alfresco.util.Pair getPropertyValueById(java.lang.Long id)
Description copied from interface: PropertyValueDAO
Use for accessing unique properties; see interface comments.

alf_prop_value accessor: get a property based on the database ID

Specified by:
getPropertyValueById in interface PropertyValueDAO
Parameters:
id - the ID (may not be null)

getPropertyValue

public org.alfresco.util.Pair getPropertyValue(java.io.Serializable value)
Description copied from interface: PropertyValueDAO
Use for accessing unique properties; see interface comments.

alf_prop_value accessor: find a property based on the value

Specified by:
getPropertyValue in interface PropertyValueDAO
Parameters:
value - the value to find the ID for (may be null)

getOrCreatePropertyValue

public org.alfresco.util.Pair getOrCreatePropertyValue(java.io.Serializable value)
Description copied from interface: PropertyValueDAO
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).

Specified by:
getOrCreatePropertyValue in interface PropertyValueDAO
Parameters:
value - the value to find the ID for (may be null)

findPropertyValueById

protected abstract PropertyValueEntity findPropertyValueById(java.lang.Long id)

findPropertyValueByValue

protected abstract PropertyValueEntity findPropertyValueByValue(java.io.Serializable value)

createPropertyValue

protected abstract PropertyValueEntity createPropertyValue(java.io.Serializable value)

getPropertyById

public java.io.Serializable getPropertyById(java.lang.Long id)
Description copied from interface: PropertyValueDAO
Use for accessing non-unique, exploded properties; see interface comments.

alf_prop_root accessor: get a property based on the database ID

Specified by:
getPropertyById in interface PropertyValueDAO
Parameters:
id - the ID (may not be null)
Returns:
Returns the value of the property (never null)

getPropertiesByIds

public void getPropertiesByIds(java.util.List ids,
                               PropertyValueDAO.PropertyFinderCallback callback)
Description copied from interface: PropertyValueDAO
Use for accessing non-unique, exploded properties; see interface comments.

alf_prop_root accessor: get all properties based on the database IDs

Specified by:
getPropertiesByIds in interface PropertyValueDAO
Parameters:
ids - the IDs (may not be null; may be empty)
callback - the callback to handle the results

createProperty

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

Specified by:
createProperty in interface PropertyValueDAO
Parameters:
value - the value to create (may be null)
Returns:
Returns the new property's ID
See Also:
#createPropertyImpl(Serializable, int, int)

updateProperty

public void updateProperty(java.lang.Long rootPropId,
                           java.io.Serializable value)
Description copied from interface: PropertyValueDAO
Use for accessing non-unique, exploded properties; see interface comments.

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

Specified by:
updateProperty in interface PropertyValueDAO
Parameters:
rootPropId - the ID of the root property to change
value - the new property value

deleteProperty

public void deleteProperty(java.lang.Long id)
Description copied from interface: PropertyValueDAO
Use for accessing non-unique, exploded properties; see interface comments.

alf_prop_root accessor: delete a property root completely

Specified by:
deleteProperty in interface PropertyValueDAO
Parameters:
id - the ID of the root property to delete

constructEmptyContainer

protected java.io.Serializable constructEmptyContainer(java.lang.Class clazz)
Returns a reconstructable instance

Returns:
Returns an empty instance of the given container (map or collection), or null if it is not possible to do

findPropertyById

protected abstract java.util.List findPropertyById(java.lang.Long id)

findPropertiesByIds

protected abstract void findPropertiesByIds(java.util.List ids,
                                            PropertyValueDAO.PropertyFinderCallback callback)

createPropertyRoot

protected abstract java.lang.Long createPropertyRoot()

getPropertyRoot

protected abstract PropertyRootEntity getPropertyRoot(java.lang.Long id)

updatePropertyRoot

protected abstract PropertyRootEntity updatePropertyRoot(PropertyRootEntity entity)

deletePropertyRoot

protected abstract void deletePropertyRoot(java.lang.Long id)

createPropertyLink

protected abstract void createPropertyLink(java.lang.Long rootPropId,
                                           java.lang.Long propIndex,
                                           java.lang.Long containedIn,
                                           java.lang.Long keyPropId,
                                           java.lang.Long valuePropId)
Create an entry for the map or collection link.

Parameters:
rootPropId - the root (entry-point) property ID
propIndex - the property number within the root property
containedIn - the property that contains the current value
keyPropId - the map key entity ID or collection position count
valuePropId - the ID of the entity storing the value (may be another map or collection)

deletePropertyLinks

protected abstract int deletePropertyLinks(java.lang.Long rootPropId)
Remove all property links for a given property root.

Parameters:
rootPropId - the root (entry-point) property ID

createPropertyUniqueContext

public org.alfresco.util.Pair createPropertyUniqueContext(java.io.Serializable value1,
                                                          java.io.Serializable value2,
                                                          java.io.Serializable value3,
                                                          java.io.Serializable propertyValue1)
Description copied from interface: PropertyValueDAO
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.

Specified by:
createPropertyUniqueContext in interface PropertyValueDAO
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

getPropertyUniqueContext

public org.alfresco.util.Pair getPropertyUniqueContext(java.io.Serializable value1,
                                                       java.io.Serializable value2,
                                                       java.io.Serializable value3)
Description copied from interface: PropertyValueDAO
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.

Specified by:
getPropertyUniqueContext in interface PropertyValueDAO
Returns:
Returns the ID-valueId pair or null if the context doesn't exist.
See Also:
PropertyValueDAO.createPropertyUniqueContext(Serializable, Serializable, Serializable, Serializable)

getPropertyUniqueContext

public void getPropertyUniqueContext(PropertyValueDAO.PropertyUniqueContextCallback callback,
                                     java.io.Serializable[] values)
Description copied from interface: PropertyValueDAO
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.

Specified by:
getPropertyUniqueContext in interface PropertyValueDAO
values - a combination of one to three values in order
See Also:
PropertyValueDAO.createPropertyUniqueContext(Serializable, Serializable, Serializable, Serializable)

updatePropertyUniqueContext

public void updatePropertyUniqueContext(java.lang.Long id,
                                        java.io.Serializable value1,
                                        java.io.Serializable value2,
                                        java.io.Serializable value3)
Description copied from interface: PropertyValueDAO
Update the unique context, preserving any associated property.

Specified by:
updatePropertyUniqueContext in interface PropertyValueDAO
See Also:
PropertyValueDAO.createPropertyUniqueContext(Serializable, Serializable, Serializable, Serializable)

updatePropertyUniqueContext

public void updatePropertyUniqueContext(java.lang.Long id,
                                        java.io.Serializable propertyValue)
Description copied from interface: PropertyValueDAO
Update the property associated with a unique context.

Specified by:
updatePropertyUniqueContext in interface PropertyValueDAO
See Also:
PropertyValueDAO.createPropertyUniqueContext(Serializable, Serializable, Serializable, Serializable)

deletePropertyUniqueContext

public int deletePropertyUniqueContext(java.io.Serializable[] values)
Description copied from interface: PropertyValueDAO
Delete sets of unique contexts based on one, two or three context values.

Specified by:
deletePropertyUniqueContext in interface PropertyValueDAO
Parameters:
values - a combination of one to three values in order
Returns:
Returns the number of unique contexts deleted

createPropertyUniqueContext

protected abstract PropertyUniqueContextEntity createPropertyUniqueContext(java.lang.Long valueId1,
                                                                           java.lang.Long valueId2,
                                                                           java.lang.Long valueId3,
                                                                           java.lang.Long propertyId)

getPropertyUniqueContextById

protected abstract PropertyUniqueContextEntity getPropertyUniqueContextById(java.lang.Long id)

getPropertyUniqueContextByValues

protected abstract PropertyUniqueContextEntity getPropertyUniqueContextByValues(java.lang.Long valueId1,
                                                                                java.lang.Long valueId2,
                                                                                java.lang.Long valueId3)

getPropertyUniqueContextByValues

protected abstract void getPropertyUniqueContextByValues(PropertyValueDAO.PropertyUniqueContextCallback callback,
                                                         java.lang.Long[] valueIds)

updatePropertyUniqueContext

protected abstract PropertyUniqueContextEntity updatePropertyUniqueContext(PropertyUniqueContextEntity entity)

deletePropertyUniqueContexts

protected abstract int deletePropertyUniqueContexts(java.lang.Long[] valueIds)

convertPropertyIdSearchRows

public java.io.Serializable convertPropertyIdSearchRows(java.util.List rows)
Description copied from interface: PropertyValueDAO
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.

Specified by:
convertPropertyIdSearchRows in interface PropertyValueDAO
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


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