org.exolab.castor.persist.spi
public interface QueryExpression
A query experession object is created for each unique query, populated with the query parameters and the SQL statement is obtained from it at the proper time.
A query expression is generated from {@link PersistenceFactory}, see this interface for information on how to configure it. The operators defined in this interface are part of SQL 92 and the supported OQL syntax and are expected to be supported by all query expressions.
Version: $Revision: 1.1.1.1 $ $Date: 2003/03/03 07:08:52 $
Field Summary | |
---|---|
String | OpBetween
Between operator. |
String | OpBetweenAnd
Between and operator. |
String | OpEquals
Equality operator. |
String | OpGreater
Greater then operator. |
String | OpGreaterEquals
Greater then or equals operator. |
String | OpLess
Less then operator. |
String | OpLessEquals
Less then or equals operator. |
String | OpLike
Like operator. |
String | OpNotEquals
Inequality operator. |
String | OpNotLike
Not like operator. |
Method Summary | |
---|---|
void | addColumn(String tableName, String columnName)
Add a column used in the query. |
void | addCondition(String tableName, String columnName, String condOp, String value)
Add a condition.
|
void | addInnerJoin(String leftTable, String leftColumn, String rightTable, String rightColumn)
Add an inner join.
|
void | addInnerJoin(String leftTable, String leftColumn, String leftTableAlias, String rightTable, String rightColumn, String rightTableAlias)
Add an inner join with an aliases for the tables
|
void | addInnerJoin(String leftTable, String[] leftColumn, String rightTable, String[] rightColumn)
Add an inner join
|
void | addInnerJoin(String leftTable, String[] leftColumn, String leftTableAlias, String rightTable, String[] rightColumn, String rightTableAlias)
Add an inner join with an aliases for the tables
|
void | addLimitClause(String limitClause)
Adds an limit clause. |
void | addOrderClause(String orderClause)
Adds an order by clause. |
void | addOuterJoin(String leftTable, String leftColumn, String rightTable, String rightColumn)
Add an outer join. |
void | addOuterJoin(String leftTable, String leftColumn, String rightTable, String rightColumn, String rightTableAlias)
Add an outer join. |
void | addOuterJoin(String leftTable, String[] leftColumn, String rightTable, String[] rightColumn) |
void | addOuterJoin(String leftTable, String[] leftColumn, String rightTable, String[] rightColumn, String rightTableAlias) |
void | addParameter(String tableName, String columnName, String condOp)
Add a query paramater.
|
void | addSelect(String selectClause)
Add an entire select clause to the query with one call. |
void | addTable(String tableName)
Add a table to the from clause.
|
void | addTable(String tableName, String tableAlias)
Add a table with an alias to the from clause.
|
void | addWhereClause(String whereClause)
Adds a where clause. |
Object | clone()
Returns a clone of the query expression that can be further
modified. |
String | encodeColumn(String tableName, String columnName)
Encode a TableColumn for use in expressions
|
String | getStatement(boolean writeLock)
Return the query expression as an SQL statement. |
void | setDistinct(boolean distinct)
Set the query to be distinct. |
See Also: OpBetweenAnd
See Also: OpBetween
Parameters: tableName The table name columnName The column name
Parameters: tableName The table name columnName The column name condOp The conditional operation value The conditional value
Parameters: leftTable The table name on the left side leftColumn The column name on the left side rightTable The table name on the right side rightColumn The column name on the right side
Parameters: leftTable The table name on the left side leftColumn The column name on the left side leftTableAlias The alias name to use for the table on the left side rightTable The table name on the right side rightColumn The column name on the right side rightTableAlias The alias name to use for the table on the right side
Parameters: leftTable The table name on the left side leftColumn The column names on the left side rightTable The table name on the right side rightColumn The column names on the right side
Parameters: leftTable The table name on the left side leftColumn The column names on the left side leftTableAlias The alias name to use for the table on the left side rightTable The table name on the right side rightColumn The column names on the right side rightTableAlias The alias name to use for the table on the right side
Parameters: limitClause The LIMIT clause to add (without the word LIMIT).
Parameters: orderClause The ORDER BY clause to add (without the words ORDER BY).
Parameters: leftTable The table name on the left side leftColumn The column name on the left side rightTable The table name on the right side rightColumn The column name on the right side
Parameters: leftTable The table name on the left side leftColumn The column name on the left side rightTable The table name on the right side rightColumn The column name on the right side rightTableAlias The alias name to use for the table on the right side
Parameters: tableName The table name columnName The column name condOp The conditional operation
Parameters: selectClause The entire sql select clause without the word SELECT
Parameters: tableName The name of the table to add to the select clause
Parameters: tableName The name of the table to add to the select clause tableAlias The name of the alias under which the where clauses will access it
Parameters: whereClause The WHERE clause to add (without the word WHERE).
Parameters: tableName The table name columnName The column name
Parameters: writeLock True if a write lock is required
Returns: The SQL statement
Throws: QueryException The query cannot be constructed for this engine
Parameters: distinct If the query should include DISTINCT in the SQL select.