Package org.apache.openjpa.datacache
Class QueryKey
java.lang.Object
org.apache.openjpa.datacache.QueryKey
- All Implemented Interfaces:
Externalizable,Serializable
This class stores information about a particular invocation of
a query. It contains a reference to the external properties of the
query that was executed, as well as any parameters used to execute
that query, with one exception: first-class objects used as
parameter values are converted to OIDs.
- Author:
- Patrick Linskey
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanchangeInvalidatesQuery(Collection<Class<?>> changed) Returnstrueif modifications to any of the classes inchangedresults in a possible invalidation of this query; otherwise returnsfalse.booleanDetermine equality based on identifying information.Returns the set of the accessPathClassnames that exists in the queryReturns the candidate class name for this query.intReturn the amount of time this key is good for.inthashCode()Define a hashing algorithm corresponding to theequals(java.lang.Object)method defined above.static QueryKeynewInstance(Query q) Return a key for the given query, or null if it is not cacheable.static QueryKeynewInstance(Query q, Object[] args) Return a key for the given query, or null if it is not cacheable.static QueryKeynewInstance(Query q, Map<Object, Object> args) Return a key for the given query, or null if it is not cacheable.voidtoString()void
-
Constructor Details
-
QueryKey
public QueryKey()Public constructor for externalization only.
-
-
Method Details
-
newInstance
Return a key for the given query, or null if it is not cacheable. -
newInstance
Return a key for the given query, or null if it is not cacheable. -
newInstance
Return a key for the given query, or null if it is not cacheable. -
getCandidateTypeName
Returns the candidate class name for this query. -
getTimeout
public int getTimeout()Return the amount of time this key is good for. -
changeInvalidatesQuery
Returnstrueif modifications to any of the classes inchangedresults in a possible invalidation of this query; otherwise returnsfalse. Invalidation is possible if one or more of the classes in this query key's access path has been changed. -
equals
Determine equality based on identifying information. Keys created for queries that specify a candidate collection are always not equal. -
hashCode
public int hashCode()Define a hashing algorithm corresponding to theequals(java.lang.Object)method defined above. -
toString
-
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
getAcessPathClassNames
Returns the set of the accessPathClassnames that exists in the query- Returns:
- -- Returns a set of accesspath classnames.
-