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.String
Condition_Prop
static java.lang.String
Sort_Prop
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Query
addCondition(Condition aCondition)
Adds a condition to query.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.void
addSort(Sort aSort)
Adds a sort or sorts to list.void
addSort(Sort aSort, int anIndex)
Adds a sort at given index.Query
clone()
Standard clone implementation.boolean
equals(java.lang.Object anObj)
Standard equals implementation.Condition
getCondition()
Returns the condition.java.lang.String
getEntityName()
Returns the data source entity name.int
getFetchLimit()
Returns the fetch limit.int
getFetchLimitDefault()
Returns the fetch limit default (Integer.MAX_VALUE).java.util.List<java.lang.String>
getJSONKeys()
RMJSONArchiver.GetKeys method.int
getSortCount()
Returns the number of sorts.java.util.List<Sort>
getSorts()
Returns the list of sorts.void
propertyChange(java.beans.PropertyChangeEvent anEvent)
Implement PropertyChangeListener method to forward on.Sort
removeSort(int anIndex)
Removes a sort at given index.int
removeSort(Sort aSort)
Removes given sort.void
setCondition(Condition aCondition)
Sets the condition.void
setEntityName(java.lang.String anEntityName)
Sets the data source entity name.void
setFetchLimit(int aValue)
Sets the fetch limit.void
setSorts(java.util.List<Sort> theSorts)
Sets the list of sorts.java.lang.String
toString()
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:
equals
in classjava.lang.Object
-
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent anEvent)
Implement PropertyChangeListener method to forward on.- Specified by:
propertyChange
in interfacejava.beans.PropertyChangeListener
-
clone
public Query clone()
Standard clone implementation.- Overrides:
clone
in classRMListenerList
-
getJSONKeys
public java.util.List<java.lang.String> getJSONKeys()
RMJSONArchiver.GetKeys method.- Specified by:
getJSONKeys
in interfaceRMJSONArchiver.GetKeys
-
-