sqlquery.html

来自「基于mondrian 开源框架进行OLAP多维分析」· HTML 代码 · 共 871 行 · 第 1/3 页

HTML
871
字号
<TD><CODE><B><A HREF="../../../mondrian/rolap/sql/SqlQuery.html#addGroupingFunction(java.lang.String)">addGroupingFunction</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;columnExpr)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../mondrian/rolap/sql/SqlQuery.html#addGroupingSet(java.util.List)">addGroupingSet</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html" title="class or interface in java.util">List</A>&lt;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&gt;&nbsp;groupingColumnsExpr)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../mondrian/rolap/sql/SqlQuery.html#addHaving(java.lang.String)">addHaving</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;expression)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../mondrian/rolap/sql/SqlQuery.html#addOrderBy(java.lang.String, boolean, boolean, boolean)">addOrderBy</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;expr,           boolean&nbsp;ascending,           boolean&nbsp;prepend,           boolean&nbsp;nullable)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adds an item to the ORDER BY clause.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../mondrian/rolap/sql/SqlQuery.html#addSelect(java.lang.String)">addSelect</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;expression)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adds an expression to the select clause, automatically creating a column alias.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../mondrian/rolap/sql/SqlQuery.html#addSelect(java.lang.String, java.lang.String)">addSelect</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;expression,          <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;alias)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adds an expression to the select clause, with a specified column alias.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../mondrian/rolap/sql/SqlQuery.html#addWhere(java.lang.String)">addWhere</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;expression)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../mondrian/rolap/sql/SqlQuery.html#addWhere(java.lang.String, java.lang.String, java.lang.String)">addWhere</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;exprLeft,         <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;exprMid,         <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;exprRight)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../../mondrian/rolap/sql/SqlQuery.html" title="class in mondrian.rolap.sql">SqlQuery</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../mondrian/rolap/sql/SqlQuery.html#cloneEmpty()">cloneEmpty</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates an empty <code>SqlQuery</code> with the same environment as this one.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../mondrian/rolap/sql/SqlQuery.html#getCurrentSelectListSize()">getCurrentSelectListSize</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../../mondrian/rolap/sql/SqlQuery.Dialect.html" title="class in mondrian.rolap.sql">SqlQuery.Dialect</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../mondrian/rolap/sql/SqlQuery.html#getDialect()">getDialect</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;<A HREF="../../../mondrian/rolap/sql/SqlQuery.html" title="class in mondrian.rolap.sql">SqlQuery</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../mondrian/rolap/sql/SqlQuery.html#newQuery(java.sql.Connection, java.lang.String)">newQuery</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/sql/Connection.html" title="class or interface in java.sql">Connection</A>&nbsp;jdbcConnection,         <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;err)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;<A HREF="../../../mondrian/rolap/sql/SqlQuery.html" title="class in mondrian.rolap.sql">SqlQuery</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../mondrian/rolap/sql/SqlQuery.html#newQuery(javax.sql.DataSource, java.lang.String)">newQuery</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/javax/sql/DataSource.html" title="class or interface in javax.sql">DataSource</A>&nbsp;dataSource,         <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;err)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../mondrian/rolap/sql/SqlQuery.html#nextColumnAlias()">nextColumnAlias</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../mondrian/rolap/sql/SqlQuery.html#print(java.io.PrintWriter, java.lang.String)">print</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/io/PrintWriter.html" title="class or interface in java.io">PrintWriter</A>&nbsp;pw,      <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;prefix)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Prints this SqlQuery to a PrintWriter with each clause on a separate line, and with the specified indentation prefix.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../mondrian/rolap/sql/SqlQuery.html#setDistinct(boolean)">setDistinct</A></B>(boolean&nbsp;distinct)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../mondrian/rolap/sql/SqlQuery.html#toString()">toString</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR></TABLE>&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></B></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD></TR></TABLE>&nbsp;<P><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TH></TR></TABLE><A NAME="SqlQuery(mondrian.rolap.sql.SqlQuery.Dialect, boolean)"><!-- --></A><H3>SqlQuery</H3><PRE>public <B>SqlQuery</B>(<A HREF="../../../mondrian/rolap/sql/SqlQuery.Dialect.html" title="class in mondrian.rolap.sql">SqlQuery.Dialect</A>&nbsp;dialect,                boolean&nbsp;formatted)</PRE><DL><DD>Base constructor used by all other constructors to create an empty instance.<P><DL><DT><B>Parameters:</B><DD><CODE>dialect</CODE> - Dialect<DD><CODE>formatted</CODE> - Whether to generate SQL formatted on multiple lines</DL></DL><HR><A NAME="SqlQuery(mondrian.rolap.sql.SqlQuery.Dialect)"><!-- --></A><H3>SqlQuery</H3><PRE>public <B>SqlQuery</B>(<A HREF="../../../mondrian/rolap/sql/SqlQuery.Dialect.html" title="class in mondrian.rolap.sql">SqlQuery.Dialect</A>&nbsp;dialect)</PRE><DL><DD>Creates a SqlQuery using a given dialect and inheriting the formatting preferences from <A HREF="../../../mondrian/olap/MondrianProperties.html#GenerateFormattedSql"><CODE>MondrianProperties.GenerateFormattedSql</CODE></A> property.<P><DL><DT><B>Parameters:</B><DD><CODE>dialect</CODE> - Dialect</DL></DL><HR><A NAME="SqlQuery(java.sql.DatabaseMetaData)"><!-- --></A><H3>SqlQuery</H3><PRE>public <B>SqlQuery</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/sql/DatabaseMetaData.html" title="class or interface in java.sql">DatabaseMetaData</A>&nbsp;databaseMetaData)</PRE><DL><DD>Creates a <code>SqlQuery</code><P><DL><DT><B>Parameters:</B><DD><CODE>databaseMetaData</CODE> - used to determine which dialect of     SQL to generate. Must not be held beyond the constructor.</DL></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Method Detail</B></FONT></TH></TR></TABLE><A NAME="cloneEmpty()"><!-- --></A><H3>cloneEmpty</H3><PRE>public <A HREF="../../../mondrian/rolap/sql/SqlQuery.html" title="class in mondrian.rolap.sql">SqlQuery</A> <B>cloneEmpty</B>()</PRE><DL><DD>Creates an empty <code>SqlQuery</code> with the same environment as this one. (As per the Gang of Four 'prototype' pattern.)<P><DD><DL></DL></DD></DL><HR><A NAME="setDistinct(boolean)"><!-- --></A><H3>setDistinct</H3><PRE>public void <B>setDistinct</B>(boolean&nbsp;distinct)</PRE><DL><DD><DL></DL></DD></DL><HR><A NAME="addFromQuery(java.lang.String, java.lang.String, boolean)"><!-- --></A><H3>addFromQuery</H3><PRE>public boolean <B>addFromQuery</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;query,                            <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;alias,                            boolean&nbsp;failIfExists)</PRE><DL><DD>Adds a subquery to the FROM clause of this Query with a given alias. If the query already exists it either, depending on <code>failIfExists</code>, throws an exception or does not add the query and returns false.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>query</CODE> - Subquery<DD><CODE>alias</CODE> - (if not null, must not be zero length).<DD><CODE>failIfExists</CODE> - if true, throws exception if alias already exists<DT><B>Returns:</B><DD>true if query *was* added<DT><B>Pre-condition:</B></DT>  <DD>alias != null</DD></DL></DD></DL><HR><A NAME="addFromTable(java.lang.String, java.lang.String, java.lang.String, java.lang.String, boolean)"><!-- --></A><H3>addFromTable</H3><PRE>boolean <B>addFromTable</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;schema,                     <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;table,                     <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;alias,                     <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;filter,                     boolean&nbsp;failIfExists)</PRE><DL><DD>Adds <code>[schema.]table AS alias</code> to the FROM clause.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>schema</CODE> - schema name; may be null<DD><CODE>table</CODE> - table name<DD><CODE>alias</CODE> - table alias, may not be null              (if not null, must not be zero length).<DD><CODE>filter</CODE> - Extra filter condition, or null<DD><CODE>failIfExists</CODE> - Whether to throw a RuntimeException if from clause   already contains this alias<DT><B>Returns:</B><DD>true if table was added<DT><B>Pre-condition:</B></DT>  <DD>alias != null</DD></DL></DD></DL><HR><A NAME="addFrom(mondrian.rolap.sql.SqlQuery, java.lang.String, boolean)"><!-- --></A><H3>addFrom</H3><PRE>public void <B>addFrom</B>(<A HREF="../../../mondrian/rolap/sql/SqlQuery.html" title="class in mondrian.rolap.sql">SqlQuery</A>&nbsp;sqlQuery,

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?