|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.alfresco.repo.domain.propval.AbstractPropertyValueDAOImpl
public abstract class AbstractPropertyValueDAOImpl
Abstract implementation for Property Value DAO.
This provides basic services such as caching, but defers to the underlying implementation for CRUD operations.
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 |
---|
protected final org.apache.commons.logging.Log logger
protected PropertyTypeConverter converter
protected ControlDAO controlDAO
Constructor Detail |
---|
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.
Method Detail |
---|
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 propertyClassCache)
propertyClassCache
- the cache of IDs to property classespublic void setPropertyDateValueCache(org.alfresco.repo.cache.SimpleCache propertyDateValueCache)
propertyDateValueCache
- the cache of IDs to property valuespublic void setPropertyStringValueCache(org.alfresco.repo.cache.SimpleCache propertyStringValueCache)
propertyStringValueCache
- the cache of IDs to property string valuespublic void setPropertyDoubleValueCache(org.alfresco.repo.cache.SimpleCache propertyDoubleValueCache)
propertyDoubleValueCache
- the cache of IDs to property valuespublic void setPropertySerializableValueCache(org.alfresco.repo.cache.SimpleCache propertySerializableValueCache)
propertySerializableValueCache
- the cache of IDs to property valuespublic void setPropertyValueCache(org.alfresco.repo.cache.SimpleCache propertyValueCache)
propertyValueCache
- the cache of IDs to property valuespublic void setPropertyCache(org.alfresco.repo.cache.SimpleCache propertyCache)
propertyValueCache
- the cache of IDs to property valuespublic org.alfresco.util.Pair getPropertyClassById(java.lang.Long id)
PropertyValueDAO
getPropertyClassById
in interface PropertyValueDAO
id
- the ID (may not be null)public org.alfresco.util.Pair getPropertyClass(java.lang.Class value)
PropertyValueDAO
getPropertyClass
in interface PropertyValueDAO
value
- the value to find the ID for (may not be null)public org.alfresco.util.Pair getOrCreatePropertyClass(java.lang.Class value)
PropertyValueDAO
getOrCreatePropertyClass
in interface PropertyValueDAO
value
- the value to find the ID for (may not be null)protected abstract PropertyClassEntity findClassById(java.lang.Long id)
protected abstract PropertyClassEntity findClassByValue(java.lang.Class value)
protected abstract PropertyClassEntity createClass(java.lang.Class value)
public org.alfresco.util.Pair getPropertyDateValueById(java.lang.Long id)
PropertyValueDAO
getPropertyDateValueById
in interface PropertyValueDAO
id
- the ID (may not be null)public org.alfresco.util.Pair getPropertyDateValue(java.util.Date value)
PropertyValueDAO
getPropertyDateValue
in interface PropertyValueDAO
value
- the value to find the ID for (may not be null)public org.alfresco.util.Pair getOrCreatePropertyDateValue(java.util.Date value)
PropertyValueDAO
getOrCreatePropertyDateValue
in interface PropertyValueDAO
value
- the value to find the ID for (may not be null)protected abstract PropertyDateValueEntity findDateValueById(java.lang.Long id)
protected abstract PropertyDateValueEntity findDateValueByValue(java.util.Date value)
value
- a date, accurate to the dayprotected abstract PropertyDateValueEntity createDateValue(java.util.Date value)
value
- a date, accurate to the daypublic org.alfresco.util.Pair getPropertyStringCaseSensitiveSearchParameters(java.lang.String value)
PropertyValueDAO
getPropertyStringCaseSensitiveSearchParameters
in interface PropertyValueDAO
CrcHelper
public org.alfresco.util.Pair getPropertyStringValueById(java.lang.Long id)
PropertyValueDAO
getPropertyStringValueById
in interface PropertyValueDAO
id
- the ID (may not be null)public org.alfresco.util.Pair getPropertyStringValue(java.lang.String value)
PropertyValueDAO
getPropertyStringValue
in interface PropertyValueDAO
value
- the value to find the ID for (may not be null)public org.alfresco.util.Pair getOrCreatePropertyStringValue(java.lang.String value)
PropertyValueDAO
getOrCreatePropertyStringValue
in interface PropertyValueDAO
value
- the value to find the ID for (may not be null)protected abstract java.lang.String findStringValueById(java.lang.Long id)
protected abstract java.lang.Long findStringValueByValue(java.lang.String value)
protected abstract java.lang.Long createStringValue(java.lang.String value)
public org.alfresco.util.Pair getPropertyDoubleValueById(java.lang.Long id)
PropertyValueDAO
getPropertyDoubleValueById
in interface PropertyValueDAO
id
- the ID (may not be null)public org.alfresco.util.Pair getPropertyDoubleValue(java.lang.Double value)
PropertyValueDAO
getPropertyDoubleValue
in interface PropertyValueDAO
value
- the value to find the ID for (may not be null)public org.alfresco.util.Pair getOrCreatePropertyDoubleValue(java.lang.Double value)
PropertyValueDAO
getOrCreatePropertyDoubleValue
in interface PropertyValueDAO
value
- the value to find the ID for (may not be null)protected abstract PropertyDoubleValueEntity findDoubleValueById(java.lang.Long id)
protected abstract PropertyDoubleValueEntity findDoubleValueByValue(java.lang.Double value)
protected abstract PropertyDoubleValueEntity createDoubleValue(java.lang.Double value)
public org.alfresco.util.Pair getPropertySerializableValueById(java.lang.Long id)
PropertyValueDAO
getPropertySerializableValueById
in interface PropertyValueDAO
id
- the ID (may not be null)public org.alfresco.util.Pair createPropertySerializableValue(java.io.Serializable value)
PropertyValueDAO
createPropertySerializableValue
in interface PropertyValueDAO
value
- the value to find the ID for (may not be null)protected abstract PropertySerializableValueEntity findSerializableValueById(java.lang.Long id)
protected abstract PropertySerializableValueEntity createSerializableValue(java.io.Serializable value)
public org.alfresco.util.Pair getPropertyValueById(java.lang.Long id)
PropertyValueDAO
getPropertyValueById
in interface PropertyValueDAO
id
- the ID (may not be null)public org.alfresco.util.Pair getPropertyValue(java.io.Serializable value)
PropertyValueDAO
getPropertyValue
in interface PropertyValueDAO
value
- the value to find the ID for (may be null)public org.alfresco.util.Pair getOrCreatePropertyValue(java.io.Serializable value)
PropertyValueDAO
#getOrCreatePropertyValue(Serializable, int)
.
getOrCreatePropertyValue
in interface PropertyValueDAO
value
- the value to find the ID for (may be null)protected abstract PropertyValueEntity findPropertyValueById(java.lang.Long id)
protected abstract PropertyValueEntity findPropertyValueByValue(java.io.Serializable value)
protected abstract PropertyValueEntity createPropertyValue(java.io.Serializable value)
public java.io.Serializable getPropertyById(java.lang.Long id)
PropertyValueDAO
getPropertyById
in interface PropertyValueDAO
id
- the ID (may not be null)
public void getPropertiesByIds(java.util.List 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 java.lang.Long createProperty(java.io.Serializable value)
createProperty
in interface PropertyValueDAO
value
- the value to create (may be null)
#createPropertyImpl(Serializable, int, int)
public void updateProperty(java.lang.Long rootPropId, java.io.Serializable value)
PropertyValueDAO
updateProperty
in interface PropertyValueDAO
rootPropId
- the ID of the root property to changevalue
- the new property valuepublic void deleteProperty(java.lang.Long id)
PropertyValueDAO
deleteProperty
in interface PropertyValueDAO
id
- the ID of the root property to deleteprotected java.io.Serializable constructEmptyContainer(java.lang.Class clazz)
protected abstract java.util.List findPropertyById(java.lang.Long id)
protected abstract void findPropertiesByIds(java.util.List ids, PropertyValueDAO.PropertyFinderCallback callback)
protected abstract java.lang.Long createPropertyRoot()
protected abstract PropertyRootEntity getPropertyRoot(java.lang.Long id)
protected abstract PropertyRootEntity updatePropertyRoot(PropertyRootEntity entity)
protected abstract void deletePropertyRoot(java.lang.Long id)
protected abstract void createPropertyLink(java.lang.Long rootPropId, java.lang.Long propIndex, java.lang.Long containedIn, java.lang.Long keyPropId, java.lang.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(java.lang.Long rootPropId)
rootPropId
- the root (entry-point) property IDpublic org.alfresco.util.Pair createPropertyUniqueContext(java.io.Serializable value1, java.io.Serializable value2, java.io.Serializable value3, java.io.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 getPropertyUniqueContext(java.io.Serializable value1, java.io.Serializable value2, java.io.Serializable value3)
PropertyValueDAO
getPropertyUniqueContext
in interface PropertyValueDAO
PropertyValueDAO.createPropertyUniqueContext(Serializable, Serializable, Serializable, Serializable)
public void getPropertyUniqueContext(PropertyValueDAO.PropertyUniqueContextCallback callback, java.io.Serializable[] values)
PropertyValueDAO
getPropertyUniqueContext
in interface PropertyValueDAO
values
- a combination of one to three values in orderPropertyValueDAO.createPropertyUniqueContext(Serializable, Serializable, Serializable, Serializable)
public void updatePropertyUniqueContext(java.lang.Long id, java.io.Serializable value1, java.io.Serializable value2, java.io.Serializable value3)
PropertyValueDAO
updatePropertyUniqueContext
in interface PropertyValueDAO
PropertyValueDAO.createPropertyUniqueContext(Serializable, Serializable, Serializable, Serializable)
public void updatePropertyUniqueContext(java.lang.Long id, java.io.Serializable propertyValue)
PropertyValueDAO
updatePropertyUniqueContext
in interface PropertyValueDAO
PropertyValueDAO.createPropertyUniqueContext(Serializable, Serializable, Serializable, Serializable)
public int deletePropertyUniqueContext(java.io.Serializable[] values)
PropertyValueDAO
deletePropertyUniqueContext
in interface PropertyValueDAO
values
- a combination of one to three values in order
protected abstract PropertyUniqueContextEntity createPropertyUniqueContext(java.lang.Long valueId1, java.lang.Long valueId2, java.lang.Long valueId3, java.lang.Long propertyId)
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)
protected abstract PropertyUniqueContextEntity updatePropertyUniqueContext(PropertyUniqueContextEntity entity)
protected abstract int deletePropertyUniqueContexts(java.lang.Long[] valueIds)
public java.io.Serializable convertPropertyIdSearchRows(java.util.List rows)
PropertyValueDAO
convertPropertyIdSearchRows
in interface PropertyValueDAO
rows
- the search results for a single root property
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |