|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public static interface EntityLookupCache.EntityLookupCallbackDAO
Interface to support lookups of the entities using keys and values.
Method Summary | |
---|---|
org.alfresco.util.Pair |
createValue(java.lang.Object value)
Create an entity using the given values. |
int |
deleteByKey(java.io.Serializable key)
Delete an entity for the given key. |
int |
deleteByValue(java.lang.Object value)
Delete an entity for the given value. |
org.alfresco.util.Pair |
findByKey(java.io.Serializable key)
Find an entity for a given key. |
org.alfresco.util.Pair |
findByValue(java.lang.Object value)
Find and entity using the given value key. |
java.io.Serializable |
getValueKey(java.lang.Object value)
Resolve the given value into a unique value key that can be used to find the entity's ID. |
int |
updateValue(java.io.Serializable key,
java.lang.Object value)
Update the entity identified by the given key. |
Method Detail |
---|
java.io.Serializable getValueKey(java.lang.Object value)
equals
and hashCode
.
Were no adequate key can be generated for the value, then null can be returned.
In this case, the findByValue
method might not even do a search
and just return null itself i.e. if it is difficult to look the value up in storage
then it is probably difficult to generate a cache key from it, too.. In this scenario, the
cache will be purely for key-based lookups
value
- the full value being keyed (never null)
org.alfresco.util.Pair findByKey(java.io.Serializable key)
key
- the key (ID) used to identify the entity (never null)
org.alfresco.util.Pair findByValue(java.lang.Object value)
equals
and hashCode
methods of the value object should respect case-sensitivity in the same way that this
lookup treats case-sensitivity i.e. if the equals
method is case-sensitive
then this method should look the entity up using a case-sensitive search.
Since this is a cache backed by some sort of database, null values are allowed by the
cache. The implementation of this method can throw an exception if null is not
appropriate for the use-case.
If the search is impossible or expensive, this method should just return null. This
would usually be the case if the getValueKey
method also returned
null i.e. if it is difficult to look the value up in storage then it is probably
difficult to generate a cache key from it, too.
value
- the value (business object) used to identify the entity (null allowed).
org.alfresco.util.Pair createValue(java.lang.Object value)
value
- the value (business object) used to identify the entity (null allowed).
int updateValue(java.io.Serializable key, java.lang.Object value)
key
- the existing key (ID) used to identify the entity (never null)value
- the new value
java.lang.UnsupportedOperationException
- if entity updates are not supportedint deleteByKey(java.io.Serializable key)
key
- the key (ID) used to identify the entity (never null)
java.lang.UnsupportedOperationException
- if entity deletion is not supportedint deleteByValue(java.lang.Object value)
value
- the value (business object) used to identify the enitity (null allowed)
java.lang.UnsupportedOperationException
- if entity deletion is not supported
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |