public class SelectImpl extends Object implements Select
Select implementation. Usage note: though this class
implements Joins, it should not be used for joining directly.
Instead, use the return value of newJoins().| Modifier and Type | Class and Description |
|---|---|
static class |
SelectImpl.SelectResult
A
Result implementation wrapped around this select. |
protected static class |
SelectImpl.Selects
Helper class to track selected columns, with fast contains method.
|
| Modifier and Type | Field and Description |
|---|---|
protected SelectImpl |
_outer |
protected SelectImpl.Selects |
_selects |
EAGER_INNER, EAGER_OUTER, EAGER_PARALLEL, FROM_SELECT_ALIAS, SUBS_ANY_JOINABLE, SUBS_EXACT, SUBS_JOINABLE, SUBS_NONE, TYPE_JOINLESS, TYPE_TWO_PART| Constructor and Description |
|---|
SelectImpl(JDBCConfiguration conf)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addJoinClassConditions()
Apply class conditions from relation joins.
|
Joins |
and(Joins joins1,
Joins joins2)
AND the given joins together.
|
void |
append(SQLBuffer buf,
Joins joins)
Append the given joins to the given buffer.
|
void |
clearOrdering()
Clear odering conditions.
|
void |
clearPlaceholderSelects()
Clear selected placeholders, and return removed select indexes.
|
void |
clearSelects()
Clear the existing column selects.
|
SelectImpl |
clone(Context ctx) |
Joins |
crossJoin(Table localTable,
Table foreignTable)
Perform a cross join on the given tables.
|
Context |
ctx()
Return the JPQL query context of this select
|
SelectExecutor |
eagerClone(FieldMapping key,
int eagerType,
boolean toMany,
int sels)
Return a select that will be eagerly executed with this one, or null if
the select cannot be created for the given key and join type.
|
Result |
execute(JDBCStore store,
JDBCFetchConfiguration fetch)
Execute this select in the context of the given store manager.
|
Result |
execute(JDBCStore store,
JDBCFetchConfiguration fetch,
int lockLevel)
Execute this select in the context of the given store manager.
|
protected Result |
execute(StoreContext ctx,
JDBCStore store,
JDBCFetchConfiguration fetch,
int lockLevel)
Execute this select in the context of the given store manager.
|
protected ResultSet |
executeQuery(Connection conn,
PreparedStatement stmnt,
SQLBuffer sql,
boolean isLRS,
JDBCStore store)
This method is to provide override for non-JDBC or JDBC-like
implementation of executing query.
|
ResultSet |
executeQuery(Connection conn,
PreparedStatement stmnt,
String sql,
JDBCStore store,
Object[] params,
Column[] cols)
This method is to provide override for non-JDBC or JDBC-like
implementation of executing query.
|
SelectExecutor |
fullClone(int sels)
Return a SELECT that is a complete clone of this one.
|
Map |
getAliases() |
boolean |
getAutoDistinct()
Whether to automatically make results distinct when relational joins
would otherwise introduce duplicates.
|
String |
getColumnAlias(Column col)
Return the alias for the given column.
|
String |
getColumnAlias(Column col,
Joins joins)
Return the alias for the given column.
|
String |
getColumnAlias(Column col,
Object path)
Return the alias for the give column
|
String |
getColumnAlias(String col,
Table table)
Return the alias for the given column.
|
String |
getColumnAlias(String col,
Table table,
Joins joins)
Return the alias for the given column.
|
JDBCConfiguration |
getConfiguration()
Return the select configuration.
|
String |
getCorrelatedVariable()
Return correlated variable name
|
int |
getCount(JDBCStore store)
Return the number of instances matching this select.
|
protected int |
getCount(ResultSet rs)
This method is to provide override for non-JDBC or JDBC-like
implementation of getting count from the result set.
|
DBDictionary |
getDictionary() |
SelectExecutor |
getEager(FieldMapping key)
Return the eager select for the given key.
|
Map |
getEagerMap()
Return view of eager selects.
|
Result |
getEagerResult(Connection conn,
PreparedStatement stmnt,
ResultSet rs,
JDBCStore store,
JDBCFetchConfiguration fetch,
boolean forUpdate,
SQLBuffer sql)
This method is to provide override for non-JDBC or JDBC-like
implementation of executing eager selects.
|
long |
getEndIndex()
The result end index.
|
List |
getExcludedJoinedTableClassMeta()
get joined table metadatas excluded for polymorphic queries
|
int |
getExpectedResultCount()
The expected result count for the query.
|
Select |
getFromSelect()
Another select instance that creates a temporary table from which
this select pulls data.
|
SQLBuffer |
getGrouping()
Return the grouping SQL for this select.
|
boolean |
getHasSubselect()
Return the flag to indicate whether this Select has
internally generated subselect
|
SQLBuffer |
getHaving()
Return the HAVING clause, or null if none.
|
List |
getIdentifierAliases()
Get the aliases for identifier columns that can be used in COUNT
selects to find the number of matches.
|
List |
getJoinedTableClassMeta()
get joined table metadatas for polymorphic queries
|
Iterator |
getJoinIterator()
Return the top-level
Join elements for this select. |
Joins |
getJoins()
Return the top-level joins for this select.
|
int |
getJoinSyntax()
The join syntax for this select, as one of the syntax constants from
JoinSyntaxes. |
SQLBuffer |
getOrdering()
Return the ordering SQL for this select.
|
Select |
getParent()
Return the parent of this select, if it is a subselect.
|
String |
getPathStr() |
Select |
getSelect()
The select owner of this join
|
List |
getSelectAliases()
Return the aliases of all selected columns and all selected buffers,
in the order they were selected.
|
List |
getSelects()
Return the actual
Vals and Columns that were
selected, in the order that they were selected. |
SQLBuffer |
getSQL()
Get the buffer if it has been computed by a previous call to
SelectExecutor.toSelect(boolean, JDBCFetchConfiguration), if any. |
long |
getStartIndex()
The result start index.
|
String |
getSubselectPath()
Return the subselect path for this select, if it is a subselect.
|
List |
getSubselects()
Return this select's subselects, or empty collection if none.
|
Collection |
getTableAliases()
Return the set of all used table aliases.
|
ClassMapping |
getTablePerClassMeta()
get table-per-class metadata for polymorphic queries
|
Map |
getTables() |
SQLBuffer |
getWhere()
Return the WHERE clause, minus any necessary end joins.
|
void |
groupBy(ClassMapping mapping,
int subclasses,
JDBCStore store,
JDBCFetchConfiguration fetch)
Group by the columns of the given mapping, possibly including subclasses.
|
void |
groupBy(ClassMapping mapping,
int subclasses,
JDBCStore store,
JDBCFetchConfiguration fetch,
Joins joins)
Group by the columns of the given mapping, possibly including subclasses.
|
void |
groupBy(Column col)
Group by the given column.
|
void |
groupBy(Column[] cols)
Group by the given columns.
|
void |
groupBy(Column[] cols,
Joins joins)
Group by the given columns.
|
void |
groupBy(Column col,
Joins joins)
Group by the given column.
|
void |
groupBy(SQLBuffer sql)
Add a GROUP BY clause.
|
void |
groupBy(SQLBuffer sql,
Joins joins)
Add a GROUP BY clause.
|
void |
groupBy(String sql)
Add a GROUP BY clause.
|
void |
groupBy(String sql,
Joins joins)
Add a GROUP BY clause.
|
boolean |
hasEagerJoin(boolean toMany)
Whether this select has an eager join of the specified type.
|
boolean |
hasJoin(boolean toMany)
Whether this select has a join of the specified type.
|
boolean |
hasMultipleSelects()
Affirm if this receiver requires more than one selects to fetch its
data.
|
void |
having(SQLBuffer sql)
Add the given having conditions.
|
void |
having(SQLBuffer sql,
Joins joins)
Add the given having conditions.
|
void |
having(String sql)
Add the given having conditions.
|
void |
having(String sql,
Joins joins)
Add the given having conditions.
|
int |
indexOf()
The index of this select within the UNION, or 0.
|
void |
insertPlaceholder(String sql,
int pos)
Insert a placeholder at the given index; use a negative index
to count from the back of the select list.
|
boolean |
isAggregate()
Return true if this is an aggregate select.
|
boolean |
isDirty()
Return true if this instance has a path, any joins, or a variable.
|
boolean |
isDistinct()
Whether this is a SELECT DISTINCT / UNION ALL.
|
boolean |
isEmpty()
Whether we have any joins.
|
boolean |
isLob()
Return true if this select includes a LOB.
|
boolean |
isLRS()
Whether the result of this select should be treated as a large
result set.
|
boolean |
isOuter()
Whether this joins path results in outer joins.
|
boolean |
isSelected(Table table)
Return whether the given table is being used in this select.
|
Joins |
join(ForeignKey fk,
boolean inverse,
boolean toMany)
Join the columns of the given foreign key.
|
int |
joinCount()
Return the maximum number of joins contained in this instance at any
time.
|
Joins |
joinRelation(String name,
ForeignKey fk,
ClassMapping target,
int subs,
boolean inverse,
boolean toMany)
Join the columns of the given foreign key, which represents a relation
via the given field name.
|
org.apache.openjpa.jdbc.sql.JoinSet |
joins()
Return the set of
Join elements, or null if none. |
void |
logEagerRelations()
Extended trace that logs eager relations
|
void |
moveJoinsToParent()
Move joins that belong to subquery's parent
|
Joins |
newJoins()
Return a new instance to use for joining.
|
Joins |
newOuterJoins()
Return a new instance to use for outer joining.
|
protected SelectImpl.Selects |
newSelects() |
void |
nullJoins()
Null the set of
Join elements. |
Joins |
or(Joins joins1,
Joins joins2)
OR the given joins together.
|
int |
orderBy(Column[] cols,
boolean asc,
boolean sel)
Order by the given columns.
|
int |
orderBy(Column[] cols,
boolean asc,
Joins joins,
boolean sel)
Order by the given columns.
|
boolean |
orderBy(Column col,
boolean asc,
boolean sel)
Order by the given column.
|
boolean |
orderBy(Column col,
boolean asc,
Joins joins,
boolean sel)
Order by the given column.
|
boolean |
orderBy(SQLBuffer sql,
boolean asc,
boolean sel,
Value selAs)
Add an ORDER BY clause.
|
boolean |
orderBy(SQLBuffer sql,
boolean asc,
Joins joins,
boolean sel,
Value selAs)
Add an ORDER BY clause.
|
boolean |
orderBy(String sql,
boolean asc,
boolean sel)
Add an ORDER BY clause.
|
boolean |
orderBy(String sql,
boolean asc,
Joins joins,
boolean sel)
Add an ORDER BY clause.
|
int |
orderByPrimaryKey(ClassMapping mapping,
boolean asc,
boolean sel)
Order on the primary key columns of the given mapping,
joining to superclasses as necessary to get all columns needed to
construct an object id.
|
int |
orderByPrimaryKey(ClassMapping mapping,
boolean asc,
Joins joins,
boolean sel)
Select and order on the primary key columns of the given mapping,
joining to superclasses as necessary to get all columns needed to
construct an object id.
|
int |
orderByPrimaryKey(ClassMapping mapping,
boolean asc,
Joins joins,
boolean sel,
boolean aliasOrder)
Allow unions to set aliases on order columns.
|
Joins |
outer(Joins joins)
Return a join set making the given joins outer joins.
|
Joins |
outerJoin(ForeignKey fk,
boolean inverse,
boolean toMany)
Join the columns of the given foreign key.
|
Joins |
outerJoinRelation(String name,
ForeignKey fk,
ClassMapping target,
int subs,
boolean inverse,
boolean toMany)
Join the columns of the given foreign key, which represents a relation
via the given field name.
|
StringBuilder |
path()
Return the relation path traversed by these joins, or null if none.
|
protected PreparedStatement |
prepareStatement(Connection conn,
SQLBuffer sql,
JDBCFetchConfiguration fetch,
int rsType,
int rsConcur,
boolean isLRS)
This method is to provide override for non-JDBC or JDBC-like
implementation of preparing statement.
|
PreparedStatement |
prepareStatement(Connection conn,
String sql)
This method is to provide override for non-JDBC or JDBC-like
implementation of preparing statement.
|
void |
removeAlias(Object key) |
void |
removeTable(Object key) |
void |
select(ClassMapping mapping,
int subclasses,
JDBCStore store,
JDBCFetchConfiguration fetch,
int eager)
Select the columns of the given mapping, possibly including subclasses.
|
void |
select(ClassMapping mapping,
int subclasses,
JDBCStore store,
JDBCFetchConfiguration fetch,
int eager,
Joins joins)
Select the columns of the given mapping, possibly including subclasses.
|
boolean |
select(Column col)
Select the given column.
|
int |
select(Column[] cols)
Select the given columns.
|
int |
select(Column[] cols,
Joins joins)
Select the given columns.
|
boolean |
select(Column col,
Joins joins)
Select the given column.
|
boolean |
select(SQLBuffer sql,
Object id)
Select the given SQL; the given id object is an identifier
to use when retrieving the corresponding value from a
Result. |
boolean |
select(SQLBuffer sql,
Object id,
Joins joins)
Select the given SQL; the given id object is an identifier
to use when retrieving the corresponding value from a
Result. |
boolean |
select(String sql,
Object id)
Select the given SQL; the given id object is an identifier
to use when retrieving the corresponding value from a
Result. |
boolean |
select(String sql,
Object id,
Joins joins)
Select the given SQL; the given id object is an identifier
to use when retrieving the corresponding value from a
Result. |
void |
selectIdentifier(ClassMapping mapping,
int subclasses,
JDBCStore store,
JDBCFetchConfiguration fetch,
int eager)
Select the columns of the given mapping, possibly including subclasses.
|
void |
selectIdentifier(ClassMapping mapping,
int subclasses,
JDBCStore store,
JDBCFetchConfiguration fetch,
int eager,
Joins joins)
Select the columns of the given mapping, possibly including subclasses.
|
boolean |
selectIdentifier(Column col)
Select the given column as one that can be used to get a count of
distinct matches.
|
int |
selectIdentifier(Column[] cols)
Select the given columns as ones that can be used to get a count of
distinct matches.
|
int |
selectIdentifier(Column[] cols,
Joins joins)
Select the given columns as ones that can be used to get a count of
distinct matches.
|
boolean |
selectIdentifier(Column col,
Joins joins)
Select the given column as one that can be used to get a count of
distinct matches.
|
void |
selectPlaceholder(String sql)
Select the given SQL as a placeholder for a UNION element.
|
int |
selectPrimaryKey(ClassMapping mapping)
Select the primary key columns of the given mapping, joining to
superclasses as necessary to get all columns needed to construct
an object id.
|
int |
selectPrimaryKey(ClassMapping mapping,
Joins joins)
Select the primary key columns of the given mapping, joining to
superclasses as necessary to get all columns needed to construct
an object id.
|
void |
setAggregate(boolean agg)
Set to true for aggregate selects.
|
void |
setAutoDistinct(boolean val)
Whether to automatically make results distinct when relational joins
would otherwise introduce duplicates.
|
void |
setContext(Context context)
Set JPQL query context for this select
|
Joins |
setCorrelatedVariable(String var)
Set the correlated variable name being traversed into
with the next join.
|
void |
setDistinct(boolean distinct)
Whether this is a SELECT DISTINCT / UNION ALL.
|
void |
setExcludedJoinedTableClassMeta(List meta)
Set joined table metadatas excluded for polymorphic queries
|
void |
setExpectedResultCount(int expectedResultCount,
boolean force)
The expected result count for the query.
|
void |
setFromSelect(Select sel)
Another select instance that creates a temporary table from which
this select pulls data.
|
void |
setHasSubselect(boolean hasSub)
Set the flag to indicate whether this Select has
internally generated subselect
|
Joins |
setJoinContext(Context ctx)
Set subquery context when traversing into the next join is
in transition from parent context to subquery.
|
void |
setJoinedTableClassMeta(List meta)
Set joined table metadatas for polymorphic queries
|
void |
setJoinSyntax(int joinSyntax)
The join syntax for this select, as one of the syntax constants from
JoinSyntaxes. |
void |
setLob(boolean lob)
Set to true for selects that include LOB columns.
|
void |
setLRS(boolean lrs)
Whether the result of this select should be treated as a large
result set.
|
org.apache.openjpa.jdbc.sql.PathJoins |
setOuter(boolean outer)
Mark this as an outer joins set.
|
void |
setParent(Select parent,
String path)
Turn this select into a subselect of the given instance.
|
void |
setRange(long start,
long end)
Set the result range for this select.
|
void |
setSchemaAlias(String schemaAlias)
Record the initial schemaAlias of a join path
|
Joins |
setSubselect(String alias)
Set the subquery alias.
|
void |
setTablePerClassMeta(ClassMapping meta)
Set table-per-class metadata for polymorphic queries
|
Joins |
setVariable(String var)
Set the variable name being traversed into with the next join.
|
boolean |
supportsLocking()
Whether this select can be executed for update.
|
boolean |
supportsRandomAccess(boolean forUpdate)
Return whether this select can support a random access result set type.
|
static String |
toOrderAlias(int index)
Helper method to return the proper order alias for the given order
column index.
|
SQLBuffer |
toSelect(boolean forUpdate,
JDBCFetchConfiguration fetch)
Return this select as a SQL statement formatted for the current
dictionary.
|
SQLBuffer |
toSelectCount()
Return this select as a COUNT SQL statement formatted for the current
dictionary.
|
String |
toString()
Implement toString to generate SQL string for profiling/debuggging.
|
void |
where(Joins joins)
Add the given where conditions.
|
void |
where(SQLBuffer sql)
Add the given where conditions.
|
void |
where(SQLBuffer sql,
Joins joins)
Add the given where conditions.
|
void |
where(String sql)
Add the given where conditions.
|
void |
where(String sql,
Joins joins)
Add the given where conditions.
|
SelectExecutor |
whereClone(int sels)
Return a SELECT with the same joins and where conditions as this one.
|
void |
whereForeignKey(ForeignKey fk,
Object oid,
ClassMapping mapping,
JDBCStore store)
Add where conditions setting the given foreign key to the given
oid values.
|
void |
wherePrimaryKey(Object oid,
ClassMapping mapping,
JDBCStore store)
Add where conditions setting the mapping's primary key to the given
oid values.
|
protected final SelectImpl.Selects _selects
protected SelectImpl _outer
public SelectImpl(JDBCConfiguration conf)
public ClassMapping getTablePerClassMeta()
SelectgetTablePerClassMeta in interface Selectpublic void setTablePerClassMeta(ClassMapping meta)
SelectsetTablePerClassMeta in interface Selectpublic void setJoinedTableClassMeta(List meta)
SelectsetJoinedTableClassMeta in interface Selectpublic List getJoinedTableClassMeta()
SelectgetJoinedTableClassMeta in interface Selectpublic void setExcludedJoinedTableClassMeta(List meta)
SelectsetExcludedJoinedTableClassMeta in interface Selectpublic List getExcludedJoinedTableClassMeta()
SelectgetExcludedJoinedTableClassMeta in interface Selectpublic static String toOrderAlias(int index)
public void setContext(Context context)
SelectsetContext in interface Selectpublic Context ctx()
Selectpublic void setSchemaAlias(String schemaAlias)
SelectsetSchemaAlias in interface Selectpublic JDBCConfiguration getConfiguration()
SelectExecutorgetConfiguration in interface SelectExecutorpublic SQLBuffer toSelect(boolean forUpdate, JDBCFetchConfiguration fetch)
SelectExecutortoSelect in interface SelectExecutorpublic SQLBuffer getSQL()
SelectExecutorSelectExecutor.toSelect(boolean, JDBCFetchConfiguration), if any.getSQL in interface SelectExecutorpublic SQLBuffer toSelectCount()
SelectExecutortoSelectCount in interface SelectExecutorpublic boolean getAutoDistinct()
SelectExecutorgetAutoDistinct in interface SelectExecutorpublic void setAutoDistinct(boolean val)
SelectExecutorsetAutoDistinct in interface SelectExecutorpublic boolean isDistinct()
SelectExecutorisDistinct in interface SelectExecutorpublic void setDistinct(boolean distinct)
SelectExecutorsetDistinct in interface SelectExecutorpublic boolean isLRS()
SelectExecutorisLRS in interface SelectExecutorpublic void setLRS(boolean lrs)
SelectExecutorsetLRS in interface SelectExecutorpublic int getExpectedResultCount()
SelectExecutorgetExpectedResultCount in interface SelectExecutorpublic void setExpectedResultCount(int expectedResultCount,
boolean force)
SelectExecutorsetExpectedResultCount in interface SelectExecutorforce - if false, the count will be discarded if this select has
any to-many eager joins that would throw off the result countpublic int getJoinSyntax()
SelectExecutorJoinSyntaxes.getJoinSyntax in interface SelectExecutorpublic void setJoinSyntax(int joinSyntax)
SelectExecutorJoinSyntaxes.setJoinSyntax in interface SelectExecutorpublic boolean supportsRandomAccess(boolean forUpdate)
SelectExecutorsupportsRandomAccess in interface SelectExecutorpublic boolean supportsLocking()
SelectExecutorsupportsLocking in interface SelectExecutorpublic boolean hasMultipleSelects()
SelectExecutorhasMultipleSelects in interface SelectExecutorpublic int getCount(JDBCStore store) throws SQLException
SelectExecutorgetCount in interface SelectExecutorSQLExceptionpublic Result execute(JDBCStore store, JDBCFetchConfiguration fetch) throws SQLException
SelectExecutorexecute in interface SelectExecutorSQLExceptionpublic Result execute(JDBCStore store, JDBCFetchConfiguration fetch, int lockLevel) throws SQLException
SelectExecutorexecute in interface SelectExecutorSQLExceptionprotected Result execute(StoreContext ctx, JDBCStore store, JDBCFetchConfiguration fetch, int lockLevel) throws SQLException
SQLExceptionprotected PreparedStatement prepareStatement(Connection conn, SQLBuffer sql, JDBCFetchConfiguration fetch, int rsType, int rsConcur, boolean isLRS) throws SQLException
SQLExceptionpublic PreparedStatement prepareStatement(Connection conn, String sql) throws SQLException
SQLExceptionprotected ResultSet executeQuery(Connection conn, PreparedStatement stmnt, SQLBuffer sql, boolean isLRS, JDBCStore store) throws SQLException
SQLExceptionpublic ResultSet executeQuery(Connection conn, PreparedStatement stmnt, String sql, JDBCStore store, Object[] params, Column[] cols) throws SQLException
SQLExceptionprotected int getCount(ResultSet rs) throws SQLException
SQLExceptionpublic Result getEagerResult(Connection conn, PreparedStatement stmnt, ResultSet rs, JDBCStore store, JDBCFetchConfiguration fetch, boolean forUpdate, SQLBuffer sql) throws SQLException
SQLExceptionpublic int indexOf()
Selectpublic List getSubselects()
SelectgetSubselects in interface Selectpublic Select getParent()
Selectpublic String getSubselectPath()
SelectgetSubselectPath in interface Selectpublic void setParent(Select parent, String path)
Selectpublic void setHasSubselect(boolean hasSub)
SelectsetHasSubselect in interface Selectpublic boolean getHasSubselect()
SelectgetHasSubselect in interface Selectpublic Map getAliases()
public void removeAlias(Object key)
public Map getTables()
public void removeTable(Object key)
public Select getFromSelect()
SelectgetFromSelect in interface Selectpublic void setFromSelect(Select sel)
SelectsetFromSelect in interface Selectpublic boolean hasEagerJoin(boolean toMany)
SelecthasEagerJoin in interface Selectpublic boolean hasJoin(boolean toMany)
Selectpublic boolean isSelected(Table table)
SelectisSelected in interface Selectpublic Collection getTableAliases()
SelectgetTableAliases in interface Selectpublic List getSelects()
SelectVals and Columns that were
selected, in the order that they were selected.getSelects in interface Selectpublic List getSelectAliases()
SelectSQLBuffer.getSelectAliases in interface Selectpublic List getIdentifierAliases()
SelectgetIdentifierAliases in interface Selectpublic SQLBuffer getOrdering()
SelectgetOrdering in interface Selectpublic SQLBuffer getGrouping()
SelectgetGrouping in interface Selectpublic SQLBuffer getWhere()
Selectpublic SQLBuffer getHaving()
Selectpublic void addJoinClassConditions()
SelectSelect.getJoins(), Select.getJoinIterator(), and
Select.getWhere().addJoinClassConditions in interface Selectpublic Joins getJoins()
Selectpublic Iterator getJoinIterator()
SelectJoin elements for this select.getJoinIterator in interface Selectpublic long getStartIndex()
SelectgetStartIndex in interface Selectpublic long getEndIndex()
SelectgetEndIndex in interface Selectpublic void setRange(long start,
long end)
Selectpublic String getColumnAlias(Column col)
SelectgetColumnAlias in interface Selectpublic String getColumnAlias(Column col, Joins joins)
SelectgetColumnAlias in interface Selectpublic String getColumnAlias(String col, Table table)
SelectgetColumnAlias in interface Selectpublic String getColumnAlias(String col, Table table, Joins joins)
SelectgetColumnAlias in interface Selectpublic String getColumnAlias(Column col, Object path)
getColumnAlias in interface Selectpublic boolean isAggregate()
SelectisAggregate in interface Selectpublic void setAggregate(boolean agg)
SelectsetAggregate in interface Selectpublic boolean isLob()
Selectpublic void setLob(boolean lob)
Selectpublic void clearSelects()
SelectclearSelects in interface Selectpublic boolean select(SQLBuffer sql, Object id)
SelectResult.public boolean select(SQLBuffer sql, Object id, Joins joins)
SelectResult.public boolean select(String sql, Object id)
SelectResult.public boolean select(String sql, Object id, Joins joins)
SelectResult.public void selectPlaceholder(String sql)
SelectselectPlaceholder in interface Selectpublic void insertPlaceholder(String sql, int pos)
public void clearPlaceholderSelects()
public boolean select(Column col)
Selectpublic boolean select(Column col, Joins joins)
Selectpublic int select(Column[] cols)
Selectpublic int select(Column[] cols, Joins joins)
Selectpublic void select(ClassMapping mapping, int subclasses, JDBCStore store, JDBCFetchConfiguration fetch, int eager)
Selectpublic void select(ClassMapping mapping, int subclasses, JDBCStore store, JDBCFetchConfiguration fetch, int eager, Joins joins)
Selectpublic boolean selectIdentifier(Column col)
Selectcount.selectIdentifier in interface Selectpublic boolean selectIdentifier(Column col, Joins joins)
Selectcount.selectIdentifier in interface Selectpublic int selectIdentifier(Column[] cols)
Selectcount.selectIdentifier in interface Selectpublic int selectIdentifier(Column[] cols, Joins joins)
Selectcount.selectIdentifier in interface Selectpublic void selectIdentifier(ClassMapping mapping, int subclasses, JDBCStore store, JDBCFetchConfiguration fetch, int eager)
Selectcount.selectIdentifier in interface Selectpublic void selectIdentifier(ClassMapping mapping, int subclasses, JDBCStore store, JDBCFetchConfiguration fetch, int eager, Joins joins)
Selectcount.selectIdentifier in interface Selectpublic int selectPrimaryKey(ClassMapping mapping)
SelectselectPrimaryKey in interface Selectpublic int selectPrimaryKey(ClassMapping mapping, Joins joins)
SelectselectPrimaryKey in interface Selectpublic int orderByPrimaryKey(ClassMapping mapping, boolean asc, boolean sel)
SelectorderByPrimaryKey in interface Selectpublic int orderByPrimaryKey(ClassMapping mapping, boolean asc, Joins joins, boolean sel)
SelectorderByPrimaryKey in interface Selectpublic int orderByPrimaryKey(ClassMapping mapping, boolean asc, Joins joins, boolean sel, boolean aliasOrder)
public boolean orderBy(Column col, boolean asc, boolean sel)
Selectpublic boolean orderBy(Column col, boolean asc, Joins joins, boolean sel)
Selectpublic int orderBy(Column[] cols, boolean asc, boolean sel)
Selectpublic int orderBy(Column[] cols, boolean asc, Joins joins, boolean sel)
Selectpublic boolean orderBy(SQLBuffer sql, boolean asc, boolean sel, Value selAs)
Selectpublic boolean orderBy(SQLBuffer sql, boolean asc, Joins joins, boolean sel, Value selAs)
Selectpublic boolean orderBy(String sql, boolean asc, boolean sel)
Selectpublic boolean orderBy(String sql, boolean asc, Joins joins, boolean sel)
Selectpublic void clearOrdering()
SelectclearOrdering in interface Selectpublic void wherePrimaryKey(Object oid, ClassMapping mapping, JDBCStore store)
SelectwherePrimaryKey in interface Selectpublic void whereForeignKey(ForeignKey fk, Object oid, ClassMapping mapping, JDBCStore store)
SelectwhereForeignKey in interface SelectSelect.wherePrimaryKey(java.lang.Object, org.apache.openjpa.jdbc.meta.ClassMapping, org.apache.openjpa.jdbc.kernel.JDBCStore)public void where(Joins joins)
Selectpublic void where(SQLBuffer sql)
Selectpublic void where(SQLBuffer sql, Joins joins)
Selectpublic void where(String sql)
Selectpublic void where(String sql, Joins joins)
Selectpublic void having(SQLBuffer sql)
Selectpublic void having(SQLBuffer sql, Joins joins)
Selectpublic void having(String sql)
Selectpublic void having(String sql, Joins joins)
Selectpublic void groupBy(SQLBuffer sql)
Selectpublic void groupBy(SQLBuffer sql, Joins joins)
Selectpublic void groupBy(String sql)
Selectpublic void groupBy(String sql, Joins joins)
Selectpublic void groupBy(Column col)
Selectpublic void groupBy(Column col, Joins joins)
Selectpublic void groupBy(Column[] cols)
Selectpublic void groupBy(Column[] cols, Joins joins)
Selectpublic void groupBy(ClassMapping mapping, int subclasses, JDBCStore store, JDBCFetchConfiguration fetch)
Selectpublic void groupBy(ClassMapping mapping, int subclasses, JDBCStore store, JDBCFetchConfiguration fetch, Joins joins)
Selectpublic SelectExecutor whereClone(int sels)
SelectwhereClone in interface Selectsels - number of selects to UNION together; ignored if <= 1public SelectExecutor fullClone(int sels)
Selectpublic SelectExecutor eagerClone(FieldMapping key, int eagerType, boolean toMany, int sels)
SelecteagerClone in interface Selectkey - the key for the eager selecteagerType - one of the EAGER_* constantstoMany - whether the eager join is to-manysels - number of selects to UNION together; ignored if <= 1public Map getEagerMap()
public void logEagerRelations()
SelectlogEagerRelations in interface Selectpublic SelectExecutor getEager(FieldMapping key)
Selectpublic Joins newJoins()
Selectpublic Joins newOuterJoins()
SelectnewOuterJoins in interface Selectpublic void append(SQLBuffer buf, Joins joins)
Selectpublic Joins and(Joins joins1, Joins joins2)
Selectpublic Select getSelect()
public Joins or(Joins joins1, Joins joins2)
Selectpublic Joins outer(Joins joins)
Selectpublic String toString()
Selectpublic boolean isOuter()
Joinspublic org.apache.openjpa.jdbc.sql.PathJoins setOuter(boolean outer)
public boolean isDirty()
public StringBuilder path()
public String getPathStr()
public org.apache.openjpa.jdbc.sql.JoinSet joins()
Join elements, or null if none.public int joinCount()
public void nullJoins()
Join elements.public boolean isEmpty()
Joinspublic Joins crossJoin(Table localTable, Table foreignTable)
Joinspublic Joins join(ForeignKey fk, boolean inverse, boolean toMany)
Joinspublic Joins outerJoin(ForeignKey fk, boolean inverse, boolean toMany)
Joinspublic Joins joinRelation(String name, ForeignKey fk, ClassMapping target, int subs, boolean inverse, boolean toMany)
Joinspublic Joins outerJoinRelation(String name, ForeignKey fk, ClassMapping target, int subs, boolean inverse, boolean toMany)
Joinspublic Joins setVariable(String var)
Joinspublic Joins setSubselect(String alias)
Joinspublic SelectImpl clone(Context ctx)
protected SelectImpl.Selects newSelects()
public DBDictionary getDictionary()
getDictionary in interface Selectpublic Joins setCorrelatedVariable(String var)
Joinspublic Joins setJoinContext(Context ctx)
Joinspublic String getCorrelatedVariable()
Joinspublic void moveJoinsToParent()
JoinsCopyright © 2006–2018 Apache Software Foundation. All rights reserved.