Class Query

  • All Implemented Interfaces:
    RMJSONArchiver.GetKeys, RMPropertyChanger, java.beans.PropertyChangeListener, java.lang.Cloneable, java.util.EventListener

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

      • Query

        public Query()
        Creates a new query.
      • Query

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

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

      • getEntityName

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

        public void setEntityName​(java.lang.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​(java.lang.String aPropertyName,
                                  Condition.Operator anOperator,
                                  java.lang.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 java.util.List<Sort> getSorts()
        Returns the list of sorts.
      • setSorts

        public void setSorts​(java.util.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​(java.lang.Object anObj)
        Standard equals implementation.
        Overrides:
        equals in class java.lang.Object
      • propertyChange

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

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