Class Query
- java.lang.Object
-
- com.inductiveautomation.rm.base.RMListenerList
-
- com.inductiveautomation.rm.base.RMObject
-
- com.inductiveautomation.snap.data.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.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCondition_Propstatic java.lang.StringSort_Prop
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description QueryaddCondition(Condition aCondition)Adds a condition to query.QueryaddCondition(java.lang.String aPropertyName, Condition.Operator anOperator, java.lang.Object aValue)Adds a condition to query for given property name, operator and value.voidaddSort(Sort aSort)Adds a sort or sorts to list.voidaddSort(Sort aSort, int anIndex)Adds a sort at given index.Queryclone()Standard clone implementation.booleanequals(java.lang.Object anObj)Standard equals implementation.ConditiongetCondition()Returns the condition.java.lang.StringgetEntityName()Returns the data source entity name.intgetFetchLimit()Returns the fetch limit.intgetFetchLimitDefault()Returns the fetch limit default (Integer.MAX_VALUE).java.util.List<java.lang.String>getJSONKeys()RMJSONArchiver.GetKeys method.intgetSortCount()Returns the number of sorts.java.util.List<Sort>getSorts()Returns the list of sorts.voidpropertyChange(java.beans.PropertyChangeEvent anEvent)Implement PropertyChangeListener method to forward on.SortremoveSort(int anIndex)Removes a sort at given index.intremoveSort(Sort aSort)Removes given sort.voidsetCondition(Condition aCondition)Sets the condition.voidsetEntityName(java.lang.String anEntityName)Sets the data source entity name.voidsetFetchLimit(int aValue)Sets the fetch limit.voidsetSorts(java.util.List<Sort> theSorts)Sets the list of sorts.java.lang.StringtoString()Returns a string representation of query.-
Methods inherited from class com.inductiveautomation.rm.base.RMObject
addPropertyChangeListener, animUpdate, firePropertyChange, firePropertyChange, firePropertyChange, getPCEvent, removePropertyChangeListener, sendPropertyChange
-
Methods inherited from class com.inductiveautomation.rm.base.RMListenerList
addListener, getListener, getListenerCount, getListenerCount, getListenerList, getListeners, hasListeners, removeListener
-
-
-
-
Field Detail
-
Condition_Prop
public static final java.lang.String Condition_Prop
- See Also:
- Constant Field Values
-
Sort_Prop
public static final java.lang.String Sort_Prop
- See Also:
- Constant Field Values
-
-
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(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:
equalsin classjava.lang.Object
-
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent anEvent)
Implement PropertyChangeListener method to forward on.- Specified by:
propertyChangein interfacejava.beans.PropertyChangeListener
-
clone
public Query clone()
Standard clone implementation.- Overrides:
clonein classRMListenerList
-
getJSONKeys
public java.util.List<java.lang.String> getJSONKeys()
RMJSONArchiver.GetKeys method.- Specified by:
getJSONKeysin interfaceRMJSONArchiver.GetKeys
-
-