|
JClass DesktopViews 6.3.0 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.Observable | +--com.klg.jclass.datasource.util.SqlStatement
This is the model for an sql statement.
An sql statement has the form,
SELECT qualifier.column(s) [AS] alias(es)
FROM qualifier.table(s) [AS] alias(es)
WHERE joins between tables
AND more joins between tables
AND search arguments, such as table.col = 1
Columns in the select clause are automatically aliased. Duplicate aliases are not allowed.
Constructor Summary | |
SqlStatement()
|
|
SqlStatement(String s)
|
Method Summary | |
void |
addColumn(String column)
Add a column name to the SELECT clause of an SQL statement. |
com.klg.jclass.datasource.util.SqlStatementColumn |
addColumn(String column,
String column_alias)
Add a column name to the SELECT clause of an SQL statement. |
com.klg.jclass.datasource.util.SqlStatementColumn |
addColumn(String column,
String table,
String alias)
Adds a column |
com.klg.jclass.datasource.util.SqlStatementColumn |
addColumn(String column,
String column_alias,
String table,
String alias)
Adds a column |
void |
addJoin(String parent_column,
String child_column)
Add a join between two columns. |
void |
addParameterColumn(String col)
Add a parameter column to the WHERE clause of an SQL statement. |
com.klg.jclass.datasource.util.SqlStatementTable |
addTable(com.klg.jclass.datasource.util.SqlStatementTable t)
Uniquely add a table name and its alias to the FROM clause of an SQL statement. |
com.klg.jclass.datasource.util.SqlStatementTable |
addTable(String table)
Add a table name to the FROM clause of an SQL statement. |
com.klg.jclass.datasource.util.SqlStatementTable |
addTable(String table,
String alias)
Uniquely add a table name and its alias to the FROM clause of an SQL statement. |
void |
clear()
Clear various vectors and user-defined clauses. |
Enumeration |
getColumns()
Return list of columns associated with this statement. |
Enumeration |
getJoins()
Return list of joins associated with this statement. |
Enumeration |
getTables()
Return a list of tables associated with this statement. |
String |
getText()
Return the sql statement for this level. |
boolean |
isExpertMode()
Indicates if expert mode is used. |
void |
refreshText()
The SQL statement has changed, show the statement with the new changes. |
void |
removeAllParameterColumns()
Remove all parameter columns from the WHERE clause of an SQL statement. |
void |
removeColumn(String column_alias)
Remove a column name from the SELECT clause of an SQL statement. |
void |
removeJoin(String alias)
Remove all joins of a table. |
void |
removeJoin(String parent_column,
String child_column)
Remove a join between two columns. |
void |
removeParameterColumn(String col)
Remove a parameter column from the WHERE clause of an SQL statement. |
void |
removeTable(String s)
Remove a table name by its alias from the FROM clause of an SQL statement. |
void |
setExpertMode(boolean v)
Sets to use expert mode or not. |
void |
setText(String s)
Sets the text of the actual SQL statement. |
Methods inherited from class java.util.Observable |
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SqlStatement()
public SqlStatement(String s)
Method Detail |
public void addColumn(String column)
column
- name of the column to be added in the format of
[[schema.]table.]column or [qualifier.]columnpublic com.klg.jclass.datasource.util.SqlStatementColumn addColumn(String column, String column_alias)
column
- name of the column to be added in the format of
[[schema.]table.]column or [qualifier.]columnpublic com.klg.jclass.datasource.util.SqlStatementColumn addColumn(String column, String table, String alias)
column
- column nametable
- qualified name of the tablealias
- alias or qualifed name of a tablepublic com.klg.jclass.datasource.util.SqlStatementColumn addColumn(String column, String column_alias, String table, String alias)
column
- column namecolumn_alias
- alias of a column
Alias is ensured to be unique. Thus, if the alias already
exists in the select clause, a new alias in the format
of "column_name" + counter is created.table
- qualified name of the tablealias
- alias or qualifed name of a tablepublic void removeColumn(String column_alias)
column_alias
- alias name of the columnpublic com.klg.jclass.datasource.util.SqlStatementTable addTable(String table)
table
- name of the table
SqlStatementTable
or null if table already exists.public com.klg.jclass.datasource.util.SqlStatementTable addTable(String table, String alias)
table
- name of the table
SqlStatementTable
or null if table already exists.public com.klg.jclass.datasource.util.SqlStatementTable addTable(com.klg.jclass.datasource.util.SqlStatementTable t)
SqlStatementTable
or null if table already exists.public void removeTable(String s)
public void addJoin(String parent_column, String child_column)
public void removeJoin(String parent_column, String child_column)
public void removeJoin(String alias)
alias
- alias or qualifed name of the tablepublic void addParameterColumn(String col)
public void removeParameterColumn(String col)
public void removeAllParameterColumns()
public void refreshText()
public String getText()
public void setText(String s)
public Enumeration getTables()
public Enumeration getColumns()
public Enumeration getJoins()
public void clear()
public boolean isExpertMode()
public void setExpertMode(boolean v)
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |