|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.olap4j.query.Query
public class Query
Base query model object.
Constructor Summary | |
---|---|
Query(java.lang.String name,
Cube cube)
Constructs a Query object. |
Method Summary | |
---|---|
void |
addQueryNodeListener(QueryNodeListener l)
Registers a new listener for a QueryNode. |
CellSet |
execute()
Executes the query against the current OlapConnection and returns a CellSet object representation of the data. |
java.util.Map<Axis,QueryAxis> |
getAxes()
Returns a map of the current query's axis. |
QueryAxis |
getAxis(Axis axis)
|
Cube |
getCube()
Returns the underlying cube object that is used to query against. |
QueryDimension |
getDimension(java.lang.String name)
Returns the Olap4j's Dimension object according to the name given as a parameter. |
java.util.Locale |
getLocale()
Returns the current locale with which this query is expressed. |
java.lang.String |
getName()
Returns this query's name. |
SelectNode |
getSelect()
Returns the MDX parse tree behind this Query. |
QueryAxis |
getUnusedAxis()
Returns the fictional axis into which all unused dimensions are stored. |
void |
removeQueryNodeListener(QueryNodeListener l)
De-registers a new listener for a QueryNode. |
void |
setSelectDefaultMembers(boolean selectDefaultMembers)
Behavior setter for a query. |
void |
swapAxes()
Swaps rows and columns axes. |
void |
tearDown()
Safely disposes of all underlying objects of this query and closes the underlying OlapConnection . |
void |
tearDown(boolean closeConnection)
Safely disposes of all underlying objects of this query. |
void |
validate()
Validates the current query structure. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Query(java.lang.String name, Cube cube) throws java.sql.SQLException
name
- Any arbitrary name to give to this query.cube
- A Cube object against which to build a query.
java.sql.SQLException
- If an error occurs while accessing the
cube's underlying connection.Method Detail |
---|
public SelectNode getSelect()
public Cube getCube()
public QueryDimension getDimension(java.lang.String name)
name
- The name of the dimension you want the object for.
public void swapAxes()
public QueryAxis getAxis(Axis axis)
public java.util.Map<Axis,QueryAxis> getAxes()
Be aware that modifications to this list might have unpredictable consequences.
public QueryAxis getUnusedAxis()
public void tearDown(boolean closeConnection)
closeConnection
- Whether or not to call the
Connection.close()
method of the underlying
connection.public void tearDown()
OlapConnection
.
Equivalent of calling Query.tearDown(true).
public void validate() throws OlapException
setSelectDefaultMembers(boolean)
method.
OlapException
- If the query is not valid, an exception
will be thrown and it's message will describe exactly what to fix.public CellSet execute() throws OlapException
OlapException
- If something goes sour, an OlapException will
be thrown to the caller. It could be caused by many things, like
a stale connection. Look at the root cause for more details.public java.lang.String getName()
public java.util.Locale getLocale()
public void setSelectDefaultMembers(boolean selectDefaultMembers)
selectDefaultMembers
- Enables or disables the default
member and hierarchy selection upon validation.public void addQueryNodeListener(QueryNodeListener l)
l
- The new listener object, implementation of QueryNodeListenerQueryNodeListener
public void removeQueryNodeListener(QueryNodeListener l)
l
- The listener object to de-register.QueryNodeListener
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |