Class Query

All Implemented Interfaces:
RMJSONArchiver.GetKeys, RMPropertyChanger, PropertyChangeListener, Cloneable, EventListener

public class Query extends RMObject implements RMJSONArchiver.GetKeys, PropertyChangeListener
An object to fetch a dataset from a data source entity with a set condition and parameters.
  • Field Details

  • Constructor Details

    • Query

      public Query()
      Creates a new query.
    • Query

      public Query(String anEntityName)
      Creates a new query with given entity name.
    • Query

      public Query(Entity anEntity)
      Creates a new query with given entity.
  • Method Details

    • getEntityName

      public String getEntityName()
      Returns the data source entity name.
    • setEntityName

      public void setEntityName(String anEntityName)
      Sets the data source entity name.
    • getCondition

      public Condition getCondition()
      Returns the condition.
    • setCondition

      public void setCondition(Condition aCondition)
      Sets the condition.
    • addCondition

      public Query addCondition(Condition aCondition)
      Adds a condition to query.
    • addCondition

      public Query addCondition(String aPropertyName, Condition.Operator anOperator, Object aValue)
      Adds a condition to query for given property name, operator and value.
    • getFetchLimit

      public int getFetchLimit()
      Returns the fetch limit.
    • setFetchLimit

      public void setFetchLimit(int aValue)
      Sets the fetch limit.
    • getFetchLimitDefault

      public int getFetchLimitDefault()
      Returns the fetch limit default (Integer.MAX_VALUE).
    • getSortCount

      public int getSortCount()
      Returns the number of sorts.
    • getSorts

      public List<Sort> getSorts()
      Returns the list of sorts.
    • setSorts

      public void setSorts(List<Sort> theSorts)
      Sets the list of sorts.
    • addSort

      public void addSort(Sort aSort)
      Adds a sort or sorts to list.
    • addSort

      public void addSort(Sort aSort, int anIndex)
      Adds a sort at given index.
    • removeSort

      public Sort removeSort(int anIndex)
      Removes a sort at given index.
    • removeSort

      public int removeSort(Sort aSort)
      Removes given sort.
    • equals

      public boolean equals(Object anObj)
      Standard equals implementation.
      Overrides:
      equals in class Object
    • propertyChange

      public void propertyChange(PropertyChangeEvent anEvent)
      Implement PropertyChangeListener method to forward on.
      Specified by:
      propertyChange in interface PropertyChangeListener
    • clone

      public Query clone()
      Standard clone implementation.
      Overrides:
      clone in class RMListenerList
    • getJSONKeys

      public List<String> getJSONKeys()
      RMJSONArchiver.GetKeys method.
      Specified by:
      getJSONKeys in interface RMJSONArchiver.GetKeys
    • toString

      public String toString()
      Returns a string representation of query.
      Overrides:
      toString in class RMObject