Package org.apache.cayenne.query
Class ObjectIdQuery
java.lang.Object
org.apache.cayenne.query.IndirectQuery
org.apache.cayenne.query.ObjectIdQuery
- All Implemented Interfaces:
- Serializable,- Query
public class ObjectIdQuery extends IndirectQuery
A query that matches zero or one object or data row corresponding to the ObjectId. Used
 internally by Cayenne to lookup objects by id. Notice that cache policies of
 ObjectIdQuery are different from generic 
QueryMetadata cache policies.
 ObjectIdQuery is special - it is the only query that can be done against Cayenne main
 cache, thus cache handling is significantly different from all other of the queries.- Since:
- 1.2
- See Also:
- Serialized Form
- 
Field SummaryFields Modifier and Type Field Description static intCACHEstatic intCACHE_NOREFRESHstatic intCACHE_REFRESHprotected intcachePolicyprotected booleanfetchingDataRowsprotected QueryMetadatametadataprotected EntityResolvermetadataResolverprotected ObjectIdobjectIdFields inherited from class org.apache.cayenne.query.IndirectQuerydataMap, lastResolver, name, replacementQuery
- 
Constructor SummaryConstructors Constructor Description ObjectIdQuery(ObjectId objectID)Creates a refreshing ObjectIdQuery.ObjectIdQuery(ObjectId objectId, boolean fetchingDataRows, int cachePolicy)Creates a new ObjectIdQuery.
- 
Method SummaryModifier and Type Method Description protected QuerycreateReplacementQuery(EntityResolver resolver)Creates a substitute query.booleanequals(Object object)An object is considered equal to this query if it is also a ObjectIdQuery with an equal ObjectId.intgetCachePolicy()QueryMetadatagetMetaData(EntityResolver resolver)Returns query metadata object.ObjectIdgetObjectId()inthashCode()Implements a standard hashCode contract considering custom 'equals' implementation.booleanisFetchAllowed()booleanisFetchingDataRows()booleanisFetchMandatory()StringtoString()Overrides toString() outputting a short string with query class and ObjectId.Methods inherited from class org.apache.cayenne.query.IndirectQuerycreateSQLAction, getReplacementQuery, route
- 
Field Details- 
CACHEpublic static final int CACHE- See Also:
- Constant Field Values
 
- 
CACHE_REFRESHpublic static final int CACHE_REFRESH- See Also:
- Constant Field Values
 
- 
CACHE_NOREFRESHpublic static final int CACHE_NOREFRESH- See Also:
- Constant Field Values
 
- 
objectId
- 
cachePolicyprotected int cachePolicy
- 
fetchingDataRowsprotected boolean fetchingDataRows
- 
metadataResolver
- 
metadata
 
- 
- 
Constructor Details- 
ObjectIdQueryCreates a refreshing ObjectIdQuery.
- 
ObjectIdQueryCreates a new ObjectIdQuery.
 
- 
- 
Method Details- 
getMetaDataReturns query metadata object.- Specified by:
- getMetaDatain interface- Query
- Overrides:
- getMetaDatain class- IndirectQuery
 
- 
getObjectId
- 
createReplacementQueryDescription copied from class:IndirectQueryCreates a substitute query. An implementor is free to provide an arbitrary replacement query.- Specified by:
- createReplacementQueryin class- IndirectQuery
 
- 
getCachePolicypublic int getCachePolicy()
- 
isFetchMandatorypublic boolean isFetchMandatory()
- 
isFetchAllowedpublic boolean isFetchAllowed()
- 
isFetchingDataRowspublic boolean isFetchingDataRows()
- 
toStringOverrides toString() outputting a short string with query class and ObjectId.
- 
equalsAn object is considered equal to this query if it is also a ObjectIdQuery with an equal ObjectId.
- 
hashCodepublic int hashCode()Implements a standard hashCode contract considering custom 'equals' implementation.
 
-