|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.torque.util.SqlExpression
public final class SqlExpression
This class represents a part of an SQL query found in the WHERE
section. For example:
table_a.column_a = table_b.column_a column LIKE 'F%' table.column < 3This class is used primarily by
BasePeer.
| Method Summary | |
|---|---|
static java.lang.String |
build(java.lang.String columnName,
java.lang.Object criteria,
SqlEnum comparison)
Builds a simple SQL expression. |
static java.lang.String |
build(java.lang.String columnName,
java.lang.Object criteria,
SqlEnum comparison,
boolean ignoreCase,
DB db)
Builds a simple SQL expression. |
static void |
build(java.lang.String columnName,
java.lang.Object criteria,
SqlEnum comparison,
boolean ignoreCase,
DB db,
java.lang.StringBuffer whereClause)
Builds a simple SQL expression. |
static java.lang.String |
buildInnerJoin(java.lang.String column,
java.lang.String relatedColumn)
Used to specify a join on two columns. |
static java.lang.String |
buildInnerJoin(java.lang.String column,
java.lang.String relatedColumn,
boolean ignoreCase,
DB db)
Used to specify a join on two columns. |
static void |
buildInnerJoin(java.lang.String column,
java.lang.String relatedColumn,
boolean ignoreCase,
DB db,
java.lang.StringBuffer whereClause)
Used to specify a join on two columns. |
static java.lang.String |
quoteAndEscapeText(java.lang.String rawText,
DB db)
Quotes and escapes raw text for placement in a SQL expression. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static java.lang.String buildInnerJoin(java.lang.String column,
java.lang.String relatedColumn)
column - A column in one of the tables to be joined.relatedColumn - The column in the other table to be joined.
public static java.lang.String buildInnerJoin(java.lang.String column,
java.lang.String relatedColumn,
boolean ignoreCase,
DB db)
column - A column in one of the tables to be joined.relatedColumn - The column in the other table to be joined.ignoreCase - If true and columns represent Strings, the appropriate
function defined for the database will be used to ignore
differences in case.db - Represents the database in use for vendor-specific functions.
public static void buildInnerJoin(java.lang.String column,
java.lang.String relatedColumn,
boolean ignoreCase,
DB db,
java.lang.StringBuffer whereClause)
column - A column in one of the tables to be joined.relatedColumn - The column in the other table to be joined.ignoreCase - If true and columns represent Strings, the appropriate
function defined for the database will be used to ignore
differences in case.db - Represents the database in use for vendor-specific functions.whereClause - A StringBuffer to which the sql expression will be
appended.
public static java.lang.String build(java.lang.String columnName,
java.lang.Object criteria,
SqlEnum comparison)
throws TorqueException
columnName - A column.criteria - The value to compare the column against.comparison - One of =, <, >, ^lt;=, >=, <>,
!=, LIKE, etc.
TorqueException - Any exceptions caught during processing will be
rethrown wrapped into a TorqueException.
public static java.lang.String build(java.lang.String columnName,
java.lang.Object criteria,
SqlEnum comparison,
boolean ignoreCase,
DB db)
throws TorqueException
columnName - A column.criteria - The value to compare the column against.comparison - One of =, <, >, ^lt;=, >=, <>,
!=, LIKE, etc.ignoreCase - If true and columns represent Strings, the appropriate
function defined for the database will be used to ignore
differences in case.db - Represents the database in use, for vendor specific functions.
TorqueException - Any exceptions caught during processing will be
rethrown wrapped into a TorqueException.
public static void build(java.lang.String columnName,
java.lang.Object criteria,
SqlEnum comparison,
boolean ignoreCase,
DB db,
java.lang.StringBuffer whereClause)
throws TorqueException
columnName - A column.criteria - The value to compare the column against.comparison - One of =, <, >, ^lt;=, >=, <>,
!=, LIKE, etc.ignoreCase - If true and columns represent Strings, the appropriate
function defined for the database will be used to ignore
differences in case.db - Represents the database in use, for vendor specific functions.whereClause - A StringBuffer to which the sql expression will be
appended.
TorqueException
public static java.lang.String quoteAndEscapeText(java.lang.String rawText,
DB db)
rawText - The unquoted, unescaped text to process.db - the db
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||