Class 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
    • Constructor Detail

      • ObjectIdQuery

        public ObjectIdQuery​(ObjectId objectID)
        Creates a refreshing ObjectIdQuery.
      • ObjectIdQuery

        public ObjectIdQuery​(ObjectId objectId,
                             boolean fetchingDataRows,
                             int cachePolicy)
        Creates a new ObjectIdQuery.
    • Method Detail

      • getObjectId

        public ObjectId getObjectId()
      • getCachePolicy

        public int getCachePolicy()
      • isFetchMandatory

        public boolean isFetchMandatory()
      • isFetchAllowed

        public boolean isFetchAllowed()
      • isFetchingDataRows

        public boolean isFetchingDataRows()
      • toString

        public String toString()
        Overrides toString() outputting a short string with query class and ObjectId.
        Overrides:
        toString in class Object
      • equals

        public boolean equals​(Object object)
        An object is considered equal to this query if it is also a ObjectIdQuery with an equal ObjectId.
        Overrides:
        equals in class Object
      • hashCode

        public int hashCode()
        Implements a standard hashCode contract considering custom 'equals' implementation.
        Overrides:
        hashCode in class Object