public abstract class AbstractPropertyValueDAOImpl extends Object implements PropertyValueDAO
This provides basic services such as caching, but defers to the underlying implementation for CRUD operations.
Modifier and Type | Class and Description |
---|---|
static class |
AbstractPropertyValueDAOImpl.CachePucKey
Key for PropertyUniqueContext cache
|
PropertyValueDAO.PropertyFinderCallback, PropertyValueDAO.PropertyUniqueContextCallback
Modifier and Type | Field and Description |
---|---|
protected ControlDAO |
controlDAO |
protected PropertyTypeConverter |
converter |
protected org.apache.commons.logging.Log |
logger |
Constructor and Description |
---|
AbstractPropertyValueDAOImpl()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
clearCaches() |
protected Serializable |
constructEmptyContainer(Class<?> clazz)
Returns a reconstructable instance
|
Serializable |
convertPropertyIdSearchRows(List<PropertyIdSearchRow> rows)
Utility method to convert property query results into the original value.
|
protected abstract PropertyClassEntity |
createClass(Class<?> value) |
protected abstract PropertyDateValueEntity |
createDateValue(Date value) |
protected abstract PropertyDoubleValueEntity |
createDoubleValue(Double value) |
Long |
createProperty(Serializable value)
Use for accessing non-unique, exploded properties; see interface comments.
|
protected abstract void |
createPropertyLink(Long rootPropId,
Long propIndex,
Long containedIn,
Long keyPropId,
Long valuePropId)
Create an entry for the map or collection link.
|
protected abstract Long |
createPropertyRoot() |
org.alfresco.util.Pair<Long,Serializable> |
createPropertySerializableValue(Serializable value)
FOR INTERNAL USE ONLY: Do not use directly; see interface comments.
|
protected abstract PropertyUniqueContextEntity |
createPropertyUniqueContext(Long valueId1,
Long valueId2,
Long valueId3,
Long propertyId) |
org.alfresco.util.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.
|
protected abstract PropertyValueEntity |
createPropertyValue(Serializable value) |
protected abstract PropertySerializableValueEntity |
createSerializableValue(Serializable value) |
protected abstract Long |
createStringValue(String value) |
void |
deleteProperty(Long id)
Use for accessing non-unique, exploded properties; see interface comments.
|
protected abstract int |
deletePropertyLinks(Long rootPropId)
Remove all property links for a given property root.
|
protected abstract void |
deletePropertyRoot(Long id) |
int |
deletePropertyUniqueContext(Serializable... values)
Delete sets of unique contexts based on one, two or three context values.
|
protected abstract int |
deletePropertyUniqueContexts(Long... valueIds) |
protected abstract PropertyClassEntity |
findClassById(Long id) |
protected abstract PropertyClassEntity |
findClassByValue(Class<?> value) |
protected abstract PropertyDateValueEntity |
findDateValueById(Long id) |
protected abstract PropertyDateValueEntity |
findDateValueByValue(Date value) |
protected abstract PropertyDoubleValueEntity |
findDoubleValueById(Long id) |
protected abstract PropertyDoubleValueEntity |
findDoubleValueByValue(Double value) |
protected abstract void |
findPropertiesByIds(List<Long> ids,
PropertyValueDAO.PropertyFinderCallback callback) |
protected abstract List<PropertyIdSearchRow> |
findPropertyById(Long id) |
protected abstract PropertyValueEntity |
findPropertyValueById(Long id) |
protected abstract PropertyValueEntity |
findPropertyValueByValue(Serializable value) |
protected abstract PropertySerializableValueEntity |
findSerializableValueById(Long id) |
protected abstract String |
findStringValueById(Long id) |
protected abstract Long |
findStringValueByValue(String value) |
org.alfresco.util.Pair<Long,Class<?>> |
getOrCreatePropertyClass(Class<?> value)
FOR INTERNAL USE ONLY: Do not use directly; see interface comments.
|
org.alfresco.util.Pair<Long,Date> |
getOrCreatePropertyDateValue(Date value)
FOR INTERNAL USE ONLY: Do not use directly; see interface comments.
|
org.alfresco.util.Pair<Long,Double> |
getOrCreatePropertyDoubleValue(Double value)
FOR INTERNAL USE ONLY: Do not use directly; see interface comments.
|
org.alfresco.util.Pair<Long,String> |
getOrCreatePropertyStringValue(String value)
FOR INTERNAL USE ONLY: Do not use directly; see interface comments.
|
org.alfresco.util.Pair<Long,Serializable> |
getOrCreatePropertyValue(Serializable value)
Use for accessing unique properties; see interface comments.
|
void |
getPropertiesByIds(List<Long> ids,
PropertyValueDAO.PropertyFinderCallback callback)
Use for accessing non-unique, exploded properties; see interface comments.
|
Serializable |
getPropertyById(Long id)
Use for accessing non-unique, exploded properties; see interface comments.
|
org.alfresco.util.Pair<Long,Class<?>> |
getPropertyClass(Class<?> value)
FOR INTERNAL USE ONLY: Do not use directly; see interface comments.
|
org.alfresco.util.Pair<Long,Class<?>> |
getPropertyClassById(Long id)
FOR INTERNAL USE ONLY: Do not use directly; see interface comments.
|
org.alfresco.util.Pair<Long,Date> |
getPropertyDateValue(Date value)
FOR INTERNAL USE ONLY: Do not use directly; see interface comments.
|
org.alfresco.util.Pair<Long,Date> |
getPropertyDateValueById(Long id)
FOR INTERNAL USE ONLY: Do not use directly; see interface comments.
|
org.alfresco.util.Pair<Long,Double> |
getPropertyDoubleValue(Double value)
FOR INTERNAL USE ONLY: Do not use directly; see interface comments.
|
org.alfresco.util.Pair<Long,Double> |
getPropertyDoubleValueById(Long id)
FOR INTERNAL USE ONLY: Do not use directly; see interface comments.
|
protected abstract PropertyRootEntity |
getPropertyRoot(Long id) |
org.alfresco.util.Pair<Long,Serializable> |
getPropertySerializableValueById(Long id)
FOR INTERNAL USE ONLY: Do not use directly; see interface comments.
|
org.alfresco.util.Pair<String,Long> |
getPropertyStringCaseSensitiveSearchParameters(String value)
Utility method to get query parameters for case-sensitive string searching
|
org.alfresco.util.Pair<Long,String> |
getPropertyStringValue(String value)
FOR INTERNAL USE ONLY: Do not use directly; see interface comments.
|
org.alfresco.util.Pair<Long,String> |
getPropertyStringValueById(Long id)
FOR INTERNAL USE ONLY: Do not use directly; see interface comments.
|
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.
|
org.alfresco.util.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.
|
protected abstract PropertyUniqueContextEntity |
getPropertyUniqueContextById(Long id) |
protected abstract PropertyUniqueContextEntity |
getPropertyUniqueContextByValues(Long valueId1,
Long valueId2,
Long valueId3) |
protected abstract void |
getPropertyUniqueContextByValues(PropertyValueDAO.PropertyUniqueContextCallback callback,
Long... valueIds) |
org.alfresco.util.Pair<Long,Serializable> |
getPropertyValue(Serializable value)
Use for accessing unique properties; see interface comments.
|
org.alfresco.util.Pair<Long,Serializable> |
getPropertyValueById(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<Serializable,Object> propertyCache)
Set the cache to use for alf_prop_root lookups (optional).
|
void |
setPropertyClassCache(org.alfresco.repo.cache.SimpleCache<Serializable,Object> propertyClassCache)
Set the cache to use for alf_prop_class lookups (optional).
|
void |
setPropertyDateValueCache(org.alfresco.repo.cache.SimpleCache<Serializable,Object> propertyDateValueCache)
Set the cache to use for alf_prop_date_value lookups (optional).
|
void |
setPropertyDoubleValueCache(org.alfresco.repo.cache.SimpleCache<Serializable,Object> propertyDoubleValueCache)
Set the cache to use for alf_prop_double_value lookups (optional).
|
void |
setPropertySerializableValueCache(org.alfresco.repo.cache.SimpleCache<Serializable,Object> propertySerializableValueCache)
Set the cache to use for alf_prop_serializable_value lookups (optional).
|
void |
setPropertyStringValueCache(org.alfresco.repo.cache.SimpleCache<Serializable,Object> propertyStringValueCache)
Set the cache to use for alf_prop_string_value lookups (optional).
|
void |
setPropertyUniqueContextCache(org.alfresco.repo.cache.SimpleCache<AbstractPropertyValueDAOImpl.CachePucKey,PropertyUniqueContextEntity> propertyUniqueContextCache)
Set the cache to use for unique property lookups
|
void |
setPropertyValueCache(org.alfresco.repo.cache.SimpleCache<Serializable,Object> propertyValueCache)
Set the cache to use for alf_prop_value lookups (optional).
|
void |
setUniquenessCheckEnabled(boolean uniquenessCheckEnabled)
Setter for uniquenessCheckEnabled flag
|
void |
updateProperty(Long rootPropId,
Serializable value)
Use for accessing non-unique, exploded properties; see interface comments.
|
protected abstract PropertyRootEntity |
updatePropertyRoot(PropertyRootEntity entity) |
protected abstract PropertyUniqueContextEntity |
updatePropertyUniqueContext(PropertyUniqueContextEntity entity) |
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).
|
void |
updatePropertyUniqueContextKeys(Long id,
Serializable value1,
Serializable value2,
Serializable value3)
Update the unique context, preserving any associated property.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
cleanupUnusedValues, deletePropertyUniqueContext
protected final org.apache.commons.logging.Log logger
protected PropertyTypeConverter converter
protected ControlDAO controlDAO
public AbstractPropertyValueDAOImpl()
This sets up the DAO accessors to bypass any caching to handle the case where the caches are not supplied in the setters.
public void setUniquenessCheckEnabled(boolean uniquenessCheckEnabled)
public void setPropertyUniqueContextCache(org.alfresco.repo.cache.SimpleCache<AbstractPropertyValueDAOImpl.CachePucKey,PropertyUniqueContextEntity> propertyUniqueContextCache)
public void setConverter(PropertyTypeConverter converter)
converter
- the converter that translates between external and persisted valuespublic void setControlDAO(ControlDAO controlDAO)
controlDAO
- the DAO that provides connection controlpublic void setPropertyClassCache(org.alfresco.repo.cache.SimpleCache<Serializable,Object> propertyClassCache)
propertyClassCache
- the cache of IDs to property classespublic void setPropertyDateValueCache(org.alfresco.repo.cache.SimpleCache<Serializable,Object> propertyDateValueCache)
propertyDateValueCache
- the cache of IDs to property valuespublic void setPropertyStringValueCache(org.alfresco.repo.cache.SimpleCache<Serializable,Object> propertyStringValueCache)
propertyStringValueCache
- the cache of IDs to property string valuespublic void setPropertyDoubleValueCache(org.alfresco.repo.cache.SimpleCache<Serializable,Object> propertyDoubleValueCache)
propertyDoubleValueCache
- the cache of IDs to property valuespublic void setPropertySerializableValueCache(org.alfresco.repo.cache.SimpleCache<Serializable,Object> propertySerializableValueCache)
propertySerializableValueCache
- the cache of IDs to property valuespublic void setPropertyValueCache(org.alfresco.repo.cache.SimpleCache<Serializable,Object> propertyValueCache)
propertyValueCache
- the cache of IDs to property valuespublic void setPropertyCache(org.alfresco.repo.cache.SimpleCache<Serializable,Object> propertyCache)
propertyCache
- the cache of IDs to property valuespublic org.alfresco.util.Pair<Long,Class<?>> getPropertyClassById(Long id)
PropertyValueDAO
getPropertyClassById
in interface PropertyValueDAO
id
- the ID (may not be null)public org.alfresco.util.Pair<Long,Class<?>> getPropertyClass(Class<?> value)
PropertyValueDAO
getPropertyClass
in interface PropertyValueDAO
value
- the value to find the ID for (may not be null)public org.alfresco.util.Pair<Long,Class<?>> getOrCreatePropertyClass(Class<?> value)
PropertyValueDAO
getOrCreatePropertyClass
in interface PropertyValueDAO
value
- the value to find the ID for (may not be null)protected abstract PropertyClassEntity findClassById(Long id)
protected abstract PropertyClassEntity findClassByValue(Class<?> value)
protected abstract PropertyClassEntity createClass(Class<?> value)
public org.alfresco.util.Pair<Long,Date> getPropertyDateValueById(Long id)
PropertyValueDAO
getPropertyDateValueById
in interface PropertyValueDAO
id
- the ID (may not be null)public org.alfresco.util.Pair<Long,Date> getPropertyDateValue(Date value)
PropertyValueDAO
getPropertyDateValue
in interface PropertyValueDAO
value
- the value to find the ID for (may not be null)public org.alfresco.util.Pair<Long,Date> getOrCreatePropertyDateValue(Date value)
PropertyValueDAO
getOrCreatePropertyDateValue
in interface PropertyValueDAO
value
- the value to find the ID for (may not be null)protected abstract PropertyDateValueEntity findDateValueById(Long id)
protected abstract PropertyDateValueEntity findDateValueByValue(Date value)
value
- a date, accurate to the dayprotected abstract PropertyDateValueEntity createDateValue(Date value)
value
- a date, accurate to the daypublic org.alfresco.util.Pair<String,Long> getPropertyStringCaseSensitiveSearchParameters(String value)
PropertyValueDAO
getPropertyStringCaseSensitiveSearchParameters
in interface PropertyValueDAO
CrcHelper
public org.alfresco.util.Pair<Long,String> getPropertyStringValueById(Long id)
PropertyValueDAO
getPropertyStringValueById
in interface PropertyValueDAO
id
- the ID (may not be null)public org.alfresco.util.Pair<Long,String> getPropertyStringValue(String value)
PropertyValueDAO
getPropertyStringValue
in interface PropertyValueDAO
value
- the value to find the ID for (may not be null)public org.alfresco.util.Pair<Long,String> getOrCreatePropertyStringValue(String value)
PropertyValueDAO
getOrCreatePropertyStringValue
in interface PropertyValueDAO
value
- the value to find the ID for (may not be null)public org.alfresco.util.Pair<Long,Double> getPropertyDoubleValueById(Long id)
PropertyValueDAO
getPropertyDoubleValueById
in interface PropertyValueDAO
id
- the ID (may not be null)public org.alfresco.util.Pair<Long,Double> getPropertyDoubleValue(Double value)
PropertyValueDAO
getPropertyDoubleValue
in interface PropertyValueDAO
value
- the value to find the ID for (may not be null)public org.alfresco.util.Pair<Long,Double> getOrCreatePropertyDoubleValue(Double value)
PropertyValueDAO
getOrCreatePropertyDoubleValue
in interface PropertyValueDAO
value
- the value to find the ID for (may not be null)protected abstract PropertyDoubleValueEntity findDoubleValueById(Long id)
protected abstract PropertyDoubleValueEntity findDoubleValueByValue(Double value)
protected abstract PropertyDoubleValueEntity createDoubleValue(Double value)
public org.alfresco.util.Pair<Long,Serializable> getPropertySerializableValueById(Long id)
PropertyValueDAO
getPropertySerializableValueById
in interface PropertyValueDAO
id
- the ID (may not be null)public org.alfresco.util.Pair<Long,Serializable> createPropertySerializableValue(Serializable value)
PropertyValueDAO
createPropertySerializableValue
in interface PropertyValueDAO
value
- the value to find the ID for (may not be null)protected abstract PropertySerializableValueEntity findSerializableValueById(Long id)
protected abstract PropertySerializableValueEntity createSerializableValue(Serializable value)
public org.alfresco.util.Pair<Long,Serializable> getPropertyValueById(Long id)
PropertyValueDAO
getPropertyValueById
in interface PropertyValueDAO
id
- the ID (may not be null)public org.alfresco.util.Pair<Long,Serializable> getPropertyValue(Serializable value)
PropertyValueDAO
getPropertyValue
in interface PropertyValueDAO
value
- the value to find the ID for (may be null)public org.alfresco.util.Pair<Long,Serializable> getOrCreatePropertyValue(Serializable value)
PropertyValueDAO
getOrCreatePropertyValue
in interface PropertyValueDAO
value
- the value to find the ID for (may be null)protected abstract PropertyValueEntity findPropertyValueById(Long id)
protected abstract PropertyValueEntity findPropertyValueByValue(Serializable value)
protected abstract PropertyValueEntity createPropertyValue(Serializable value)
public Serializable getPropertyById(Long id)
PropertyValueDAO
getPropertyById
in interface PropertyValueDAO
id
- the ID (may not be null)public void getPropertiesByIds(List<Long> ids, PropertyValueDAO.PropertyFinderCallback callback)
PropertyValueDAO
getPropertiesByIds
in interface PropertyValueDAO
ids
- the IDs (may not be null; may be empty)callback
- the callback to handle the resultspublic Long createProperty(Serializable value)
createProperty
in interface PropertyValueDAO
value
- the value to create (may be null)createPropertyImpl(Long, long, long, Long, Serializable)
public void updateProperty(Long rootPropId, Serializable value)
PropertyValueDAO
updateProperty
in interface PropertyValueDAO
rootPropId
- the ID of the root property to changevalue
- the new property valuepublic void deleteProperty(Long id)
PropertyValueDAO
deleteProperty
in interface PropertyValueDAO
id
- the ID of the root property to deleteprotected Serializable constructEmptyContainer(Class<?> clazz)
protected abstract List<PropertyIdSearchRow> findPropertyById(Long id)
protected abstract void findPropertiesByIds(List<Long> ids, PropertyValueDAO.PropertyFinderCallback callback)
protected abstract Long createPropertyRoot()
protected abstract PropertyRootEntity getPropertyRoot(Long id)
protected abstract PropertyRootEntity updatePropertyRoot(PropertyRootEntity entity)
protected abstract void deletePropertyRoot(Long id)
protected abstract void createPropertyLink(Long rootPropId, Long propIndex, Long containedIn, Long keyPropId, Long valuePropId)
rootPropId
- the root (entry-point) property IDpropIndex
- the property number within the root propertycontainedIn
- the property that contains the current valuekeyPropId
- the map key entity ID or collection position countvaluePropId
- the ID of the entity storing the value (may be another map or collection)protected abstract int deletePropertyLinks(Long rootPropId)
rootPropId
- the root (entry-point) property IDpublic org.alfresco.util.Pair<Long,Long> createPropertyUniqueContext(Serializable value1, Serializable value2, Serializable value3, Serializable propertyValue1)
PropertyValueDAO
createPropertyUniqueContext
in interface PropertyValueDAO
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)public org.alfresco.util.Pair<Long,Long> getPropertyUniqueContext(Serializable value1, Serializable value2, Serializable value3)
PropertyValueDAO
getPropertyUniqueContext
in interface PropertyValueDAO
value1
- first valuevalue2
- second valuevalue3
- third valuePropertyValueDAO.createPropertyUniqueContext(Serializable, Serializable, Serializable, Serializable)
public void getPropertyUniqueContext(PropertyValueDAO.PropertyUniqueContextCallback callback, Serializable... values)
PropertyValueDAO
getPropertyUniqueContext
in interface PropertyValueDAO
values
- a combination of one to three values in orderPropertyValueDAO.createPropertyUniqueContext(Serializable, Serializable, Serializable, Serializable)
public void updatePropertyUniqueContextKeys(Long id, Serializable value1, Serializable value2, Serializable value3)
PropertyValueDAO
updatePropertyUniqueContextKeys
in interface PropertyValueDAO
PropertyValueDAO.createPropertyUniqueContext(Serializable, Serializable, Serializable, Serializable)
public void updatePropertyUniqueContext(Serializable value1, Serializable value2, Serializable value3, Serializable propertyValue)
PropertyValueDAO
updatePropertyUniqueContext
in interface PropertyValueDAO
PropertyValueDAO.createPropertyUniqueContext(Serializable, Serializable, Serializable, Serializable)
public int deletePropertyUniqueContext(Serializable... values)
PropertyValueDAO
deletePropertyUniqueContext
in interface PropertyValueDAO
values
- a combination of one to three values in orderprotected abstract PropertyUniqueContextEntity createPropertyUniqueContext(Long valueId1, Long valueId2, Long valueId3, Long propertyId)
protected abstract PropertyUniqueContextEntity getPropertyUniqueContextById(Long id)
protected abstract PropertyUniqueContextEntity getPropertyUniqueContextByValues(Long valueId1, Long valueId2, Long valueId3)
protected abstract void getPropertyUniqueContextByValues(PropertyValueDAO.PropertyUniqueContextCallback callback, Long... valueIds)
protected abstract PropertyUniqueContextEntity updatePropertyUniqueContext(PropertyUniqueContextEntity entity)
protected abstract int deletePropertyUniqueContexts(Long... valueIds)
public Serializable convertPropertyIdSearchRows(List<PropertyIdSearchRow> rows)
PropertyValueDAO
convertPropertyIdSearchRows
in interface PropertyValueDAO
rows
- the search results for a single root propertyprotected void clearCaches()
Copyright © 2005–2017 Alfresco Software. All rights reserved.