Package | Description |
---|---|
org.apache.torque.criteria |
This package contains Torque's Criteria classes.
|
org.apache.torque.map |
Description of the schema layout.
|
org.apache.torque.om.mapper |
Contains the Mapper interface which defines how to map from
a ResultSet to an object, and simple implementations of this interface.
|
org.apache.torque.sql |
This package contains classes which are mainly used in the SQL generation
process.
|
org.apache.torque.sql.objectbuilder |
This package contains classes which can build
PreparedStatementParts from a single value or column.
|
org.apache.torque.util |
Misc.
|
Modifier and Type | Method and Description |
---|---|
Criteria |
Criteria.addAlias(String alias,
Criteria subselect)
Allows one to specify an alias for a subselect.
|
Criteria |
Criteria.addAlias(String alias,
String table)
Allows one to specify an alias for a table.
|
Criteria |
Criteria.addAscendingOrderByColumn(Column column)
Adds an order by clause, explicitly specifying ascending.
|
Criteria |
Criteria.addAscendingOrderByColumn(Column column,
boolean ignoreCase)
Add an order by clause, explicitly specifying ascending.
|
Criteria |
Criteria.addAsColumn(String name,
Column clause)
Add an AS clause to the select columns.
|
Criteria |
Criteria.addDescendingOrderByColumn(Column column)
Add order by column name, explicitly specifying descending.
|
Criteria |
Criteria.addDescendingOrderByColumn(Column column,
boolean ignoreCase)
Add order by column name, explicitly specifying descending.
|
Criteria |
Criteria.addFrom(FromElement fromElement)
Adds a new Element to the from clause.
|
Criteria |
Criteria.addFrom(String tableName)
Adds a table to the from clause, not using a joinType or joinCondition.
|
Criteria |
Criteria.addGroupByColumn(Column groupBy)
Add a group by clause.
|
Criteria |
Criteria.addHaving(Criterion having)
This method adds a prepared Criterion object to the Criteria as a having
clause.
|
Criteria |
Criteria.addJoin(Column left,
Column right)
Adds a join to the criteria, E.g.
|
Criteria |
Criteria.addJoin(Column left,
Column right,
JoinType joinType)
Adds a join to the criteria, E.g.
|
Criteria |
Criteria.addJoin(Column left,
Column right,
SqlEnum comparison,
JoinType joinType)
Adds a join to the criteria, E.g.
|
Criteria |
Criteria.addJoin(PreparedStatementPart leftTable,
PreparedStatementPart rightTable,
Criterion joinCondition,
JoinType joinType)
Adds a join to the criteria, E.g.
|
Criteria |
Criteria.addJoin(String leftTable,
String rightTable,
Criterion joinCondition,
JoinType joinType)
Adds a join to the criteria.
|
Criteria |
Criteria.addSelectColumn(Column column)
Adds a select column to the Criteria.
|
Criteria |
Criteria.and(Criterion criterion)
"AND"s Criterion object with the conditions in this Criteria.
|
Criteria |
Criteria.and(Object lValue,
Object rValue)
"AND"s a new condition with the conditions in this Criteria.
|
Criteria |
Criteria.and(Object lValue,
Object rValue,
SqlEnum comparison)
"AND"s a new condition with the conditions in this Criteria.
|
Criteria |
Criteria.andDate(Object lValue,
int year,
int month,
int day)
Convenience method to AND a new date comparison with the conditions
in this Criteria.
|
Criteria |
Criteria.andDate(Object lValue,
int year,
int month,
int day,
SqlEnum comparison)
Convenience method to AND a new date comparison with the conditions
in this Criteria.
|
Criteria |
Criteria.andIn(Object lValue,
Collection<?> rValues)
Convenience method to AND a "in" comparison with the conditions
in this Criteria.
|
Criteria |
Criteria.andIn(Object lValue,
Object[] rValues)
Convenience method to AND a "in" comparison with the conditions
in this Criteria.
|
Criteria |
Criteria.andNotIn(Object lValue,
Collection<?> rValues)
Convenience method to AND a "not in" comparison with the conditions
in this Criteria.
|
Criteria |
Criteria.andNotIn(Object lValue,
Object[] rValues)
Convenience method to AND a "not in" comparison with the conditions
in this Criteria.
|
Criteria |
Criteria.andVerbatimSql(String sql,
Object[] replacements)
Ands a verbatim sql condition to this Criteria.
|
Criteria |
Criteria.andVerbatimSql(String sql,
Object[] replacements,
Column toAddToFromClause1,
Column toAddToFromClause2)
ANDs a verbatim sql condition to this Criteria.
|
Criteria |
Criteria.except(Criteria other)
Creates a SQL EXCEPT between this Criteria
and the passed other criteria.
|
Criteria |
Criteria.exceptAll(Criteria other)
Creates a SQL EXCEPT between this Criteria
and the passed other criteria.
|
Criteria |
Criteria.forUpdate()
Sets that FOR UPDATE clause should be added to the query.
|
Criteria |
Criteria.getSubselectForAlias(String alias)
Returns the subselect associated with an alias.
|
Criteria |
Criteria.intersect(Criteria other)
Creates a SQL INTERSECT between this Criteria
and the passed other criteria.
|
Criteria |
Criteria.intersectAll(Criteria other)
Creates a SQL INTERSECT ALL between this Criteria
and the passed other criteria.
|
Criteria |
Criteria.or(Criterion criterion)
"OR"s a Criterion object with the conditions in this Criteria.
|
Criteria |
Criteria.or(Object lValue,
Object rValue)
"OR"s a new condition with the conditions in this Criteria.
|
Criteria |
Criteria.or(Object lValue,
Object rValue,
SqlEnum comparison)
"OR"s a new condition with the conditions in this Criteria.
|
Criteria |
Criteria.orDate(Object lValue,
int year,
int month,
int day)
Convenience method to OR a new date comparison with the conditions
in this Criteria.
|
Criteria |
Criteria.orDate(Object lValue,
int year,
int month,
int day,
SqlEnum comparison)
Convenience method to OR a new date comparison with the conditions
in this Criteria.
|
Criteria |
Criteria.orIn(Object lValue,
Collection<?> rValues)
Convenience method to OR a "in" comparison with the conditions
in this Criteria.
|
Criteria |
Criteria.orIn(Object lValue,
Object[] rValues)
Convenience method to OR a "in" comparison with the conditions
in this Criteria.
|
Criteria |
Criteria.orNotIn(Object lValue,
Collection<?> rValues)
Convenience method to OR a "not in" comparison with the conditions
in this Criteria.
|
Criteria |
Criteria.orNotIn(Object lValue,
Object[] rValues)
Convenience method to OR a "not in" comparison with the conditions
in this Criteria.
|
Criteria |
Criteria.orVerbatimSql(String sql,
Object[] replacements)
ORs a verbatim sql condition to this Criteria.
|
Criteria |
Criteria.orVerbatimSql(String sql,
Object[] replacements,
Column toAddToFromClause1,
Column toAddToFromClause2)
ORs a verbatim sql condition to this Criteria.
|
Criteria |
Criteria.setAll()
Adds "ALL " to the SQL statement.
|
Criteria |
Criteria.setDbName(String dbName)
Set the Database name.
|
Criteria |
Criteria.setDistinct()
Adds "DISTINCT " to the SQL statement.
|
Criteria |
Criteria.setFetchSize(Integer fetchSize)
Sets the JDBC statement fetch size to use for queries.
|
Criteria |
Criteria.setForUpdate(boolean forUpdate)
Sets whether FOR UPDATE clause should be added to the query.
|
Criteria |
Criteria.setIgnoreCase(boolean ignoreCase)
Sets whether case should be ignored in where clauses and order by
whenever String columns are encountered.
|
Criteria |
Criteria.setLimit(int limit)
Set a limit for the query
|
Criteria |
Criteria.setOffset(long offset)
Set the offset.
|
Criteria |
Criteria.setSingleRecord(boolean b)
Switch the check on or off that a query returns exactly one record.
|
Criteria |
Criteria.union(Criteria other)
Creates a SQL UNION between this Criteria and the passed other criteria.
|
Criteria |
Criteria.unionAll(Criteria other)
Creates a SQL UNION ALL between this Criteria
and the passed other criteria.
|
Criteria |
Criteria.where(Criterion criterion)
"AND"s Criterion object with the conditions in this Criteria.
|
Criteria |
Criteria.where(Object lValue,
Object rValue)
"AND"s a new condition with the conditions in this Criteria.
|
Criteria |
Criteria.where(Object lValue,
Object rValue,
SqlEnum comparison)
"AND"s a new condition with the conditions in this Criteria.
|
Criteria |
Criteria.whereDate(Object lValue,
int year,
int month,
int day)
Convenience method to AND a new date comparison with the conditions
in this Criteria.
|
Criteria |
Criteria.whereDate(Object lValue,
int year,
int month,
int day,
SqlEnum comparison)
Convenience method to AND a new date comparison with the conditions
in this Criteria.
|
Criteria |
Criteria.whereIn(Object lValue,
Collection<?> rValues)
Convenience method to AND a "in" comparison with the conditions
in this Criteria.
|
Criteria |
Criteria.whereIn(Object lValue,
Object[] rValues)
Convenience method to AND a "in" comparison with the conditions
in this Criteria.
|
Criteria |
Criteria.whereNotIn(Object lValue,
Collection<?> rValues)
Convenience method to AND a "not in" comparison with the conditions
in this Criteria.
|
Criteria |
Criteria.whereNotIn(Object lValue,
Object[] rValues)
Convenience method to AND a "not in" comparison with the conditions
in this Criteria.
|
Criteria |
Criteria.whereVerbatimSql(String sql,
Object[] replacements)
Convenience method to AND a verbatim sql condition to this Criteria.
|
Criteria |
Criteria.whereVerbatimSql(String sql,
Object[] replacements,
Column toAddToFromClause1,
Column toAddToFromClause2)
Convenience method to AND a verbatim sql condition to this Criteria.
|
Modifier and Type | Method and Description |
---|---|
List<Criteria> |
Criteria.getSetCriteriaParts()
Return the parts of the criteria which compose a query using
set operations (union, except, intersect).
|
Modifier and Type | Method and Description |
---|---|
Criteria |
Criteria.addAlias(String alias,
Criteria subselect)
Allows one to specify an alias for a subselect.
|
protected void |
Criteria.appendSetOperation(Criteria other,
SqlEnum setOperator)
Appends a set operation (union, except, intersect) to this Criteria.
|
Criteria |
Criteria.except(Criteria other)
Creates a SQL EXCEPT between this Criteria
and the passed other criteria.
|
Criteria |
Criteria.exceptAll(Criteria other)
Creates a SQL EXCEPT between this Criteria
and the passed other criteria.
|
Criteria |
Criteria.intersect(Criteria other)
Creates a SQL INTERSECT between this Criteria
and the passed other criteria.
|
Criteria |
Criteria.intersectAll(Criteria other)
Creates a SQL INTERSECT ALL between this Criteria
and the passed other criteria.
|
Criteria |
Criteria.union(Criteria other)
Creates a SQL UNION between this Criteria and the passed other criteria.
|
Criteria |
Criteria.unionAll(Criteria other)
Creates a SQL UNION ALL between this Criteria
and the passed other criteria.
|
Constructor and Description |
---|
Criteria(Criteria toCopy)
Copy-constructor.
|
Modifier and Type | Method and Description |
---|---|
static ColumnMap |
MapHelper.getColumnMap(Column column,
Criteria criteria)
Returns the column map for a column.
|
static TableMap |
MapHelper.getTableMap(Object possibleColumn,
Criteria criteria,
TableMap defaultTableMap)
Returns the table map for a table name.
|
Modifier and Type | Method and Description |
---|---|
BigDecimal |
BigDecimalMapper.processRow(ResultSet resultSet,
int rowOffset,
Criteria criteria)
Maps the current row in the result to a BigDecimal.
|
List<Object> |
CompositeMapper.processRow(ResultSet resultSet,
int offset,
Criteria criteria)
Maps the current row in the result Set by applying all known mappers
and putting the result of each mapper in the result list.
|
Date |
DateMapper.processRow(ResultSet resultSet,
int rowOffset,
Criteria criteria)
Maps the current row in the result set to a java.util.Date.
|
Integer |
IntegerMapper.processRow(ResultSet resultSet,
int rowOffset,
Criteria criteria)
Maps the current row in the result set to a Integer.
|
Long |
LongMapper.processRow(ResultSet resultSet,
int rowOffset,
Criteria criteria)
Maps the current row in the result set to a Long.
|
List<Object> |
ObjectListMapper.processRow(ResultSet resultSet,
int offset,
Criteria criteria)
Maps the current row in the result set by reading all columns from
offset on to the end of the row and store an object for each column
in the result.
|
T |
RecordMapper.processRow(ResultSet resultSet,
int rowOffset,
Criteria criteria)
Constructs the object from the current row in the resultSet.
|
String |
StringMapper.processRow(ResultSet resultSet,
int rowOffset,
Criteria criteria)
Maps the current row in the result set to a String.
|
Modifier and Type | Method and Description |
---|---|
static Query |
SqlBuilder.buildQuery(Criteria crit)
Builds a Query from a criteria.
|
static String |
SqlBuilder.guessFullTableFromCriteria(Criteria criteria)
Guesses a table name from a criteria by inspecting the first
column in the criteria.
|
static void |
JoinBuilder.processJoins(Criteria criteria,
Query query)
Adds the Joins from the criteria to the query.
|
Constructor and Description |
---|
PreparedStatementPartForSubselect(Criteria toBuildFrom,
Query outerQuery)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Criteria |
SummaryHelper.buildCriteria(Criteria c)
Builds the criteria to use in summarizing the information.
|
Criteria |
AbstractPeerImpl.buildCriteria(ObjectKey<?> pk)
Build a Criteria object which selects all objects which have a given
primary key.
|
abstract Criteria |
AbstractPeerImpl.buildCriteria(T obj)
Build a Criteria object from the data object for this peer.
|
abstract Criteria |
AbstractPeerImpl.buildSelectCriteria(T obj)
Build a Criteria object from the data object for this peer,
skipping all binary columns.
|
Modifier and Type | Method and Description |
---|---|
void |
BasePeerImpl.addSelectColumns(Criteria criteria)
Add all the columns needed to create a new object.
|
Criteria |
SummaryHelper.buildCriteria(Criteria c)
Builds the criteria to use in summarizing the information.
|
void |
BasePeerImpl.correctBooleans(Criteria criteria)
Checks all columns in the criteria to see whether
booleanchar and booleanint columns are queried with a boolean.
|
int |
CountHelper.count(Criteria c)
The COUNT function returns the number of rows in a query.
|
int |
CountHelper.count(Criteria c,
Column column)
Returns the number of rows in a query.
|
int |
CountHelper.count(Criteria c,
Connection conn)
The COUNT function returns the number of rows in a query.
|
int |
CountHelper.count(Criteria c,
Connection conn,
Column column)
Returns the number of rows in a query.
|
int |
CountHelper.count(Criteria c,
Connection conn,
String columnName,
TableMap tableMap)
Returns the number of rows in a query.
|
int |
CountHelper.count(Criteria c,
String columnName)
Returns the number of rows in a query.
|
int |
BasePeerImpl.doDelete(Criteria criteria)
Deletes rows from a database table.
|
int |
BasePeerImpl.doDelete(Criteria criteria,
Connection connection)
Deletes rows from a table.
|
int |
BasePeerImpl.doInsert(Column[] toInsertInto,
Criteria criteria)
Executes a insert into...select statement.
|
int |
BasePeerImpl.doInsert(Column[] toInsertInto,
Criteria criteria,
Connection connection)
Executes a insert into...select statement.
|
int |
BasePeerImpl.doInsert(Column[] toInsertInto,
Criteria criteria,
String dbName)
Executes a insert into...select statement.
|
int |
BasePeerImpl.doInsert(Column[] toInsertInto,
Criteria criteria,
String dbName,
Connection connection)
Executes a insert into...select statement.
|
List<T> |
BasePeerImpl.doSelect(Criteria criteria)
Selects objects from a database.
|
List<T> |
BasePeerImpl.doSelect(Criteria criteria,
Connection connection)
Selects objects from a database
within a transaction.
|
<TT> List<TT> |
BasePeerImpl.doSelect(Criteria criteria,
RecordMapper<TT> mapper)
Selects rows from a database an maps them to objects.
|
<TT> List<TT> |
BasePeerImpl.doSelect(Criteria criteria,
RecordMapper<TT> mapper,
Connection connection)
Performs a SQL
select using a PreparedStatement. |
Stream<T> |
BasePeerImpl.doSelectAsStream(Criteria criteria,
Connection connection)
Selects objects from a database
within a transaction.
|
<TT> Stream<TT> |
BasePeerImpl.doSelectAsStream(Criteria criteria,
RecordMapper<TT> mapper,
Connection connection)
Performs a SQL
select using a PreparedStatement. |
T |
BasePeerImpl.doSelectSingleRecord(Criteria criteria)
Selects at most one object from a database.
|
T |
BasePeerImpl.doSelectSingleRecord(Criteria criteria,
Connection connection)
Selects at most one object from a database
within a transaction.
|
<TT> TT |
BasePeerImpl.doSelectSingleRecord(Criteria criteria,
RecordMapper<TT> mapper)
Selects at most a single row from a database an maps them to objects.
|
<TT> TT |
BasePeerImpl.doSelectSingleRecord(Criteria criteria,
RecordMapper<TT> mapper,
Connection connection)
Selects at most a single row from a database an maps them to objects.
|
int |
BasePeerImpl.doUpdate(Criteria selectCriteria,
ColumnValues updateValues)
Executes an update against the database.
|
int |
BasePeerImpl.doUpdate(Criteria criteria,
ColumnValues updateValues,
Connection connection)
Executes an update against the database.
|
protected void |
BasePeerImpl.setDbName(Criteria crit)
Sets the database name in the passed criteria to the table's default,
if it is not already set.
|
List<ListOrderedMapCI<Object>> |
SummaryHelper.summarize(Criteria crit)
Return a list of ListOrderedMapCI objects with the results of the summary
query.
|
List<ListOrderedMapCI<Object>> |
SummaryHelper.summarize(Criteria crit,
Connection conn)
Return a list of OrderedMap objects with the results of the summary
query.
|
List<ListOrderedMapCI<Object>> |
SummaryHelper.summarize(Criteria crit,
List<Class<?>> resultTypes)
Return a list of ListOrderedMapCI objects with the results of the summary
query.
|
List<ListOrderedMapCI<Object>> |
SummaryHelper.summarize(Criteria crit,
List<Class<?>> resultTypes,
Connection conn)
Return a list of ListOrderedMapCI objects with the results of the summary
query.
|
Constructor and Description |
---|
LargeSelect(Criteria criteria,
int pageSize,
BasePeerImpl<T> peerImpl)
Creates a LargeSelect whose results are returned as a
List
containing a maximum of pageSize objects of the type
defined within the class named returnBuilderClassName at a
time, maintaining a maximum of LargeSelect.memoryPageLimit
pages of results in memory. |
LargeSelect(Criteria criteria,
int pageSize,
int memoryPageLimit,
BasePeerImpl<T> peerImpl)
Creates a LargeSelect whose results are returned as a
List
containing a maximum of pageSize objects of the type T at a
time, maintaining a maximum of memoryPageLimit pages of
results in memory. |
ResultsetSpliterator(RecordMapper<T> recordMapper,
Criteria criteria,
Statement statement,
ResultSet resultSet)
Constructor
|
Copyright © 2000–2020 The Apache Software Foundation. All rights reserved.