Style Intelligence v12.0

inetsoft.uql
Class XDataSelection

java.lang.Object
  extended by inetsoft.uql.XDataSelection
All Implemented Interfaces:
XDynamicQuery, Serializable, Cloneable

public class XDataSelection
extends Object
implements Cloneable, Serializable, XDynamicQuery

An XDataSelection represents a selection of query columns or data model attributes and a list of filter condtions to be applied to the resulting data. To use XDataSelection with query columns, use AttributeRef objects where the attribute property is the column name and the entity property is null.

See Also:
AttributeRef, Serialized Form

Field Summary
static int CONDITION_AND
          Flag indicating that a given condition should be and'ed to the associated column/attribute.
static int CONDITION_OR
          Flag indicating that a given condition should be or'ed to the associated column/attribute.
 
Fields inherited from interface inetsoft.uql.XDynamicQuery
MODEL_TYPE, QUERY_TYPE
 
Constructor Summary
XDataSelection(boolean fromModel)
          Deprecated. Use the XDataSelection(String) constructor instead.
XDataSelection(String type)
          Construct a new instance of DataSelection that is intended to be used with the specified type of source data.
 
Method Summary
 void addAttribute(DataRef attribute)
          Add a data model attribute or expression to the selection.
 void clear()
          Clear all attributes and conditions from this selection.
 Object clone()
           
 boolean containsAttribute(DataRef attribute)
          Check if an attribute or expression is already defined in the selection.
 UserVariable[] getAllVariables()
          Add the data selection's user variables to the list.
 DataRef getAttribute(int idx)
          Get an attribute or an expression.
 int getAttributeCount()
          Get the total number of attributes and expressions in this selection.
 Enumeration getAttributes()
          Get a list of all attributes and expression in this selection.
 ColumnSelection getColumnSelection()
          Get the column selection object.
 ConditionList getConditionList()
          Get the row selection object.
 GroupInfo getGroup()
          Get group attribute of binding.
 ColumnSelection getHiddenColumns()
          Get the hidden column selection object.
 Object getProperty(String name)
          Get a property value.
 String getSource()
          Get the name of the source of the data selection.
 String getType()
          Get the type of this selection.
 boolean isAllRows(String entity)
          Check if all rows should be included in output for the specified entity.
 boolean isDistinct()
          Determine if the query result should only contain unique rows.
 boolean isFromModel()
          Deprecated. use the getType() method to determine the type of this selection.
 boolean isSQLGroup()
          Determine if the grouping should be performed by the database (in a SQL GROUP BY clause) or during post-processing by Style Report.
 void parseXML(Element tag)
          Read in the XML representation of this object.
 void removeAllAttributes()
          Remove all attributes and expressions from the selection.
 void removeAttribute(DataRef attribute)
          Remove the specified attribute or expression from the selection.
 void setAllRows(String entity, boolean flag)
          Set whether to include all rows from an entity.
 void setColumnSelection(ColumnSelection sel)
          Set the column selection object.
 void setConditionList(ConditionList sel)
          Set the row selection object.
 void setDistinct(boolean distinct)
          Set whether the query result should only contain unique rows.
 void setFromModel(boolean fromModel)
          Deprecated. use the setType() method to set the type of this selection.
 void setGroup(GroupInfo group)
          Set group attribute of binding.
 void setHiddenColumns(ColumnSelection sel)
          Set the hidden column selection object.
 void setProperty(String name, Object val)
          Set a property value.
 void setSource(String source)
          Sets the name of the source of the data selection.
 void setSQLGroup(boolean sqlGroup)
          Set whether the grouping should be performed by the database (in a SQL GROUP BY clause) or during post-processing by Style Report.
 void setType(String type)
          Set the type of this selection.
 String toString()
           
 void writeXML(PrintWriter writer)
          Write this data selection to XML.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CONDITION_OR

public static final int CONDITION_OR
Flag indicating that a given condition should be or'ed to the associated column/attribute.

See Also:
Constant Field Values

CONDITION_AND

public static final int CONDITION_AND
Flag indicating that a given condition should be and'ed to the associated column/attribute.

See Also:
Constant Field Values
Constructor Detail

XDataSelection

public XDataSelection(boolean fromModel)
Deprecated. Use the XDataSelection(String) constructor instead.

Construct a new instance of DataSelection that is intended to be used with the specified type of source data.

Parameters:
fromModel - a flag indicating where the data will come from. true indicates that the selection will use the attributes of a data model and false that a defined query will be used.

XDataSelection

public XDataSelection(String type)
Construct a new instance of DataSelection that is intended to be used with the specified type of source data.

Parameters:
type - the type of data selection being created. This may be QUERY_TYPE or MODEL_TYPE.
Method Detail

setSource

public void setSource(String source)
Sets the name of the source of the data selection. This should be the name of either a defined query or data model.

Parameters:
source - the name of the source of the data selection.

getSource

public String getSource()
Get the name of the source of the data selection. This is the name of either a defined query or data model.

Specified by:
getSource in interface XDynamicQuery
Returns:
the name of the source of the data selection.

setFromModel

public void setFromModel(boolean fromModel)
Deprecated. use the setType() method to set the type of this selection.

Set whether the data selection comes from a data model or query.

Parameters:
fromModel - true if this is a selection of data model attributes, false for a selection of query columns.

isFromModel

public boolean isFromModel()
Deprecated. use the getType() method to determine the type of this selection.

Determine if the data selection comes from a data model or query.

Returns:
true if this is a selection of data model attributes, false for a selection of query columns.

getType

public String getType()
Get the type of this selection.

Specified by:
getType in interface XDynamicQuery
Returns:
the type flag of this selection.

setType

public void setType(String type)
Set the type of this selection.

Parameters:
type - the type flag of this selection.

clear

public void clear()
Clear all attributes and conditions from this selection.


addAttribute

public void addAttribute(DataRef attribute)
Add a data model attribute or expression to the selection.

Parameters:
attribute - an DataRef object describing a data model attribute or expression.

containsAttribute

public boolean containsAttribute(DataRef attribute)
Check if an attribute or expression is already defined in the selection.


removeAttribute

public void removeAttribute(DataRef attribute)
Remove the specified attribute or expression from the selection.

Parameters:
attribute - an DataRef object describing a data model attribute or expression.

getAttributes

public Enumeration getAttributes()
Get a list of all attributes and expression in this selection.

Returns:
a collection of DataRef objects.

getAttribute

public DataRef getAttribute(int idx)
Get an attribute or an expression.

Parameters:
idx - attribute index.

getAttributeCount

public int getAttributeCount()
Get the total number of attributes and expressions in this selection.

Returns:
total number of attributes and expressions in this selection.

removeAllAttributes

public void removeAllAttributes()
Remove all attributes and expressions from the selection.


getAllVariables

public UserVariable[] getAllVariables()
Add the data selection's user variables to the list.


writeXML

public void writeXML(PrintWriter writer)
Write this data selection to XML.

Parameters:
writer - the stream to output the XML text to.

parseXML

public void parseXML(Element tag)
              throws Exception,
                     DOMException
Read in the XML representation of this object.

Parameters:
tag - the XML element representing this object.
Throws:
Exception
DOMException

clone

public Object clone()
Overrides:
clone in class Object

setColumnSelection

public void setColumnSelection(ColumnSelection sel)
Set the column selection object.


getColumnSelection

public ColumnSelection getColumnSelection()
Get the column selection object.


setHiddenColumns

public void setHiddenColumns(ColumnSelection sel)
Set the hidden column selection object.


getHiddenColumns

public ColumnSelection getHiddenColumns()
Get the hidden column selection object.


setConditionList

public void setConditionList(ConditionList sel)
Set the row selection object.


getConditionList

public ConditionList getConditionList()
Get the row selection object.


getGroup

public GroupInfo getGroup()
Get group attribute of binding.


setGroup

public void setGroup(GroupInfo group)
Set group attribute of binding.


setAllRows

public void setAllRows(String entity,
                       boolean flag)
Set whether to include all rows from an entity. This is equivalent to an outer join in SQL.


isAllRows

public boolean isAllRows(String entity)
Check if all rows should be included in output for the specified entity.


isDistinct

public boolean isDistinct()
Determine if the query result should only contain unique rows.

Returns:
true if the query is distinct.

setDistinct

public void setDistinct(boolean distinct)
Set whether the query result should only contain unique rows.

Parameters:
distinct - true if the query is distinct.

isSQLGroup

public boolean isSQLGroup()
Determine if the grouping should be performed by the database (in a SQL GROUP BY clause) or during post-processing by Style Report.

Returns:
true if the grouping should be performed by the database; false if it should be performed by StyleReport.

setSQLGroup

public void setSQLGroup(boolean sqlGroup)
Set whether the grouping should be performed by the database (in a SQL GROUP BY clause) or during post-processing by Style Report.

Parameters:
sqlGroup - true if the grouping should be performed by the database; false if it should be performed by StyleReport.

setProperty

public void setProperty(String name,
                        Object val)
Set a property value. Property is generic interface for attaching additional information to a query object. Properties are transient and is not saved as part of the query definition.

Specified by:
setProperty in interface XDynamicQuery

getProperty

public Object getProperty(String name)
Get a property value.

Specified by:
getProperty in interface XDynamicQuery

toString

public String toString()
Overrides:
toString in class Object

Copyright © 1996-2014 InetSoft Technology Corp. All Rights Reserved.