Package org.apache.openjpa.jdbc.sql
Interface Select
-
- All Superinterfaces:
SelectExecutor
- All Known Implementing Classes:
LogicalUnion.UnionSelect,SelectImpl
public interface Select extends SelectExecutor
Abstraction of a SQL SELECT statement.- Author:
- Abe White
-
-
Field Summary
Fields Modifier and Type Field Description static intEAGER_INNERConstant indicating to batch the select using an inner join.static intEAGER_OUTERConstant indicating to batch the select using an outer join.static intEAGER_PARALLELConstant indicating to use a separate select executed in parallel.static java.lang.StringFROM_SELECT_ALIASThe alias to use for the from select, if any.static intSUBS_ANY_JOINABLEConstant indicating to select subclasses but without adding any class conditions to the select.static intSUBS_EXACTConstant indicating to select this class but without adding any class conditions to the select.static intSUBS_JOINABLEConstant indicating to add conditions to the selcet to select this class and joinable subclasses only.static intSUBS_NONEConstant indicating to add conditions to the select to select this class only.static intTYPE_JOINLESSConstant indicating a select can be made without joins.static intTYPE_TWO_PARTConstant indicating a two-part select and load.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddJoinClassConditions()Apply class conditions from relation joins.Joinsand(Joins joins1, Joins joins2)AND the given joins together.voidappend(SQLBuffer buf, Joins joins)Append the given joins to the given buffer.voidclearOrdering()Clear odering conditions.voidclearSelects()Clear the existing column selects.Contextctx()Return the JPQL query context of this selectSelectExecutoreagerClone(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.SelectExecutorfullClone(int sels)Return a SELECT that is a complete clone of this one.java.lang.StringgetColumnAlias(java.lang.String col, Table table)Return the alias for the given column.java.lang.StringgetColumnAlias(java.lang.String col, Table table, Joins joins)Return the alias for the given column.java.lang.StringgetColumnAlias(Column col)Return the alias for the given column.java.lang.StringgetColumnAlias(Column col, java.lang.Object path)Return the alias for the given column, without creating new table aliasjava.lang.StringgetColumnAlias(Column col, Joins joins)Return the alias for the given column.DBDictionarygetDictionary()SelectExecutorgetEager(FieldMapping key)Return the eager select for the given key.longgetEndIndex()The result end index.java.util.ListgetExcludedJoinedTableClassMeta()get joined table metadatas excluded for polymorphic queriesSelectgetFromSelect()Another select instance that creates a temporary table from which this select pulls data.SQLBuffergetGrouping()Return the grouping SQL for this select.booleangetHasSubselect()Return the flag to indicate whether this Select has internally generated subselectSQLBuffergetHaving()Return the HAVING clause, or null if none.java.util.ListgetIdentifierAliases()Get the aliases for identifier columns that can be used in COUNT selects to find the number of matches.java.util.ListgetJoinedTableClassMeta()get joined table metadatas for polymorphic queriesjava.util.IteratorgetJoinIterator()Return the top-levelJoinelements for this select.JoinsgetJoins()Return the top-level joins for this select.SQLBuffergetOrdering()Return the ordering SQL for this select.SelectgetParent()Return the parent of this select, if it is a subselect.java.util.ListgetSelectAliases()Return the aliases of all selected columns and all selected buffers, in the order they were selected.java.util.ListgetSelects()Return the actualVals andColumns that were selected, in the order that they were selected.longgetStartIndex()The result start index.java.lang.StringgetSubselectPath()Return the subselect path for this select, if it is a subselect.java.util.ListgetSubselects()Return this select's subselects, or empty collection if none.java.util.CollectiongetTableAliases()Return the set of all used table aliases.ClassMappinggetTablePerClassMeta()get table-per-class metadata for polymorphic queriesSQLBuffergetWhere()Return the WHERE clause, minus any necessary end joins.voidgroupBy(java.lang.String sql)Add a GROUP BY clause.voidgroupBy(java.lang.String sql, Joins joins)Add a GROUP BY clause.voidgroupBy(ClassMapping mapping, int subclasses, JDBCStore store, JDBCFetchConfiguration fetch)Group by the columns of the given mapping, possibly including subclasses.voidgroupBy(ClassMapping mapping, int subclasses, JDBCStore store, JDBCFetchConfiguration fetch, Joins joins)Group by the columns of the given mapping, possibly including subclasses.voidgroupBy(Column col)Group by the given column.voidgroupBy(Column[] cols)Group by the given columns.voidgroupBy(Column[] cols, Joins joins)Group by the given columns.voidgroupBy(Column col, Joins joins)Group by the given column.voidgroupBy(SQLBuffer sql)Add a GROUP BY clause.voidgroupBy(SQLBuffer sql, Joins joins)Add a GROUP BY clause.booleanhasEagerJoin(boolean toMany)Whether this select has an eager join of the specified type.booleanhasJoin(boolean toMany)Whether this select has a join of the specified type.voidhaving(java.lang.String sql)Add the given having conditions.voidhaving(java.lang.String sql, Joins joins)Add the given having conditions.voidhaving(SQLBuffer sql)Add the given having conditions.voidhaving(SQLBuffer sql, Joins joins)Add the given having conditions.intindexOf()The index of this select within the UNION, or 0.booleanisAggregate()Return true if this is an aggregate select.booleanisLob()Return true if this select includes a LOB.booleanisSelected(Table table)Return whether the given table is being used in this select.voidlogEagerRelations()Extended trace that logs eager relationsJoinsnewJoins()Return a new instance to use for joining.JoinsnewOuterJoins()Return a new instance to use for outer joining.Joinsor(Joins joins1, Joins joins2)OR the given joins together.booleanorderBy(java.lang.String sql, boolean asc, boolean sel)Add an ORDER BY clause.booleanorderBy(java.lang.String sql, boolean asc, Joins joins, boolean sel)Add an ORDER BY clause.intorderBy(Column[] cols, boolean asc, boolean sel)Order by the given columns.intorderBy(Column[] cols, boolean asc, Joins joins, boolean sel)Order by the given columns.booleanorderBy(Column col, boolean asc, boolean sel)Order by the given column.booleanorderBy(Column col, boolean asc, Joins joins, boolean sel)Order by the given column.booleanorderBy(SQLBuffer sql, boolean asc, boolean sel, Value selAs)Add an ORDER BY clause.booleanorderBy(SQLBuffer sql, boolean asc, Joins joins, boolean sel, Value selAs)Add an ORDER BY clause.intorderByPrimaryKey(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.intorderByPrimaryKey(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.Joinsouter(Joins joins)Return a join set making the given joins outer joins.booleanselect(java.lang.String sql, java.lang.Object id)Select the given SQL; the given id object is an identifier to use when retrieving the corresponding value from aResult.booleanselect(java.lang.String sql, java.lang.Object id, Joins joins)Select the given SQL; the given id object is an identifier to use when retrieving the corresponding value from aResult.voidselect(ClassMapping mapping, int subclasses, JDBCStore store, JDBCFetchConfiguration fetch, int eager)Select the columns of the given mapping, possibly including subclasses.voidselect(ClassMapping mapping, int subclasses, JDBCStore store, JDBCFetchConfiguration fetch, int eager, Joins joins)Select the columns of the given mapping, possibly including subclasses.booleanselect(Column col)Select the given column.intselect(Column[] cols)Select the given columns.intselect(Column[] cols, Joins joins)Select the given columns.booleanselect(Column col, Joins joins)Select the given column.booleanselect(SQLBuffer sql, java.lang.Object id)Select the given SQL; the given id object is an identifier to use when retrieving the corresponding value from aResult.booleanselect(SQLBuffer sql, java.lang.Object id, Joins joins)Select the given SQL; the given id object is an identifier to use when retrieving the corresponding value from aResult.voidselectIdentifier(ClassMapping mapping, int subclasses, JDBCStore store, JDBCFetchConfiguration fetch, int eager)Select the columns of the given mapping, possibly including subclasses.voidselectIdentifier(ClassMapping mapping, int subclasses, JDBCStore store, JDBCFetchConfiguration fetch, int eager, Joins joins)Select the columns of the given mapping, possibly including subclasses.booleanselectIdentifier(Column col)Select the given column as one that can be used to get a count of distinct matches.intselectIdentifier(Column[] cols)Select the given columns as ones that can be used to get a count of distinct matches.intselectIdentifier(Column[] cols, Joins joins)Select the given columns as ones that can be used to get a count of distinct matches.booleanselectIdentifier(Column col, Joins joins)Select the given column as one that can be used to get a count of distinct matches.voidselectPlaceholder(java.lang.String sql)Select the given SQL as a placeholder for a UNION element.intselectPrimaryKey(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.intselectPrimaryKey(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.voidsetAggregate(boolean agg)Set to true for aggregate selects.voidsetContext(Context context)Set JPQL query context for this selectvoidsetExcludedJoinedTableClassMeta(java.util.List meta)Set joined table metadatas excluded for polymorphic queriesvoidsetFromSelect(Select sel)Another select instance that creates a temporary table from which this select pulls data.voidsetHasSubselect(boolean hasSub)Set the flag to indicate whether this Select has internally generated subselectvoidsetJoinedTableClassMeta(java.util.List meta)Set joined table metadatas for polymorphic queriesvoidsetLob(boolean lob)Set to true for selects that include LOB columns.voidsetParent(Select parent, java.lang.String path)Turn this select into a subselect of the given instance.voidsetRange(long start, long end)Set the result range for this select.voidsetSchemaAlias(java.lang.String schemaAlias)Record the initial schemaAlias of a join pathvoidsetTablePerClassMeta(ClassMapping meta)Set table-per-class metadata for polymorphic queriesjava.lang.StringtoString()Implement toString to generate SQL string for profiling/debuggging.voidwhere(java.lang.String sql)Add the given where conditions.voidwhere(java.lang.String sql, Joins joins)Add the given where conditions.voidwhere(Joins joins)Add the given where conditions.voidwhere(SQLBuffer sql)Add the given where conditions.voidwhere(SQLBuffer sql, Joins joins)Add the given where conditions.SelectExecutorwhereClone(int sels)Return a SELECT with the same joins and where conditions as this one.voidwhereForeignKey(ForeignKey fk, java.lang.Object oid, ClassMapping mapping, JDBCStore store)Add where conditions setting the given foreign key to the given oid values.voidwherePrimaryKey(java.lang.Object oid, ClassMapping mapping, JDBCStore store)Add where conditions setting the mapping's primary key to the given oid values.-
Methods inherited from interface org.apache.openjpa.jdbc.sql.SelectExecutor
execute, execute, getAutoDistinct, getConfiguration, getCount, getExpectedResultCount, getJoinSyntax, getSQL, hasMultipleSelects, isDistinct, isLRS, setAutoDistinct, setDistinct, setExpectedResultCount, setJoinSyntax, setLRS, supportsLocking, supportsRandomAccess, toSelect, toSelectCount
-
-
-
-
Field Detail
-
EAGER_INNER
static final int EAGER_INNER
Constant indicating to batch the select using an inner join.- See Also:
- Constant Field Values
-
EAGER_OUTER
static final int EAGER_OUTER
Constant indicating to batch the select using an outer join.- See Also:
- Constant Field Values
-
EAGER_PARALLEL
static final int EAGER_PARALLEL
Constant indicating to use a separate select executed in parallel.- See Also:
- Constant Field Values
-
TYPE_JOINLESS
static final int TYPE_JOINLESS
Constant indicating a select can be made without joins.- See Also:
- Constant Field Values
-
TYPE_TWO_PART
static final int TYPE_TWO_PART
Constant indicating a two-part select and load.- See Also:
- Constant Field Values
-
SUBS_JOINABLE
static final int SUBS_JOINABLE
Constant indicating to add conditions to the selcet to select this class and joinable subclasses only.- See Also:
- Constant Field Values
-
SUBS_NONE
static final int SUBS_NONE
Constant indicating to add conditions to the select to select this class only.- See Also:
- Constant Field Values
-
SUBS_ANY_JOINABLE
static final int SUBS_ANY_JOINABLE
Constant indicating to select subclasses but without adding any class conditions to the select.- See Also:
- Constant Field Values
-
SUBS_EXACT
static final int SUBS_EXACT
Constant indicating to select this class but without adding any class conditions to the select.- See Also:
- Constant Field Values
-
FROM_SELECT_ALIAS
static final java.lang.String FROM_SELECT_ALIAS
The alias to use for the from select, if any.- See Also:
- Constant Field Values
-
-
Method Detail
-
indexOf
int indexOf()
The index of this select within the UNION, or 0.
-
getSubselects
java.util.List getSubselects()
Return this select's subselects, or empty collection if none.
-
getParent
Select getParent()
Return the parent of this select, if it is a subselect.
-
getSubselectPath
java.lang.String getSubselectPath()
Return the subselect path for this select, if it is a subselect.
-
setParent
void setParent(Select parent, java.lang.String path)
Turn this select into a subselect of the given instance.
-
getFromSelect
Select getFromSelect()
Another select instance that creates a temporary table from which this select pulls data.
-
setFromSelect
void setFromSelect(Select sel)
Another select instance that creates a temporary table from which this select pulls data.
-
hasEagerJoin
boolean hasEagerJoin(boolean toMany)
Whether this select has an eager join of the specified type.
-
hasJoin
boolean hasJoin(boolean toMany)
Whether this select has a join of the specified type.
-
isSelected
boolean isSelected(Table table)
Return whether the given table is being used in this select.
-
getTableAliases
java.util.Collection getTableAliases()
Return the set of all used table aliases.
-
getSelects
java.util.List getSelects()
Return the actualVals andColumns that were selected, in the order that they were selected.- Since:
- 1.1.0
-
getSelectAliases
java.util.List getSelectAliases()
Return the aliases of all selected columns and all selected buffers, in the order they were selected. Each alias may be either a string or aSQLBuffer.
-
getIdentifierAliases
java.util.List getIdentifierAliases()
Get the aliases for identifier columns that can be used in COUNT selects to find the number of matches. Each alias will be a string. If no identifier columns have been nominated, then all column alises are returned.
-
getOrdering
SQLBuffer getOrdering()
Return the ordering SQL for this select.
-
getGrouping
SQLBuffer getGrouping()
Return the grouping SQL for this select.
-
getWhere
SQLBuffer getWhere()
Return the WHERE clause, minus any necessary end joins.
-
getHaving
SQLBuffer getHaving()
Return the HAVING clause, or null if none.
-
addJoinClassConditions
void addJoinClassConditions()
Apply class conditions from relation joins. This may affect the return values ofgetJoins(),getJoinIterator(), andgetWhere().
-
getJoins
Joins getJoins()
Return the top-level joins for this select.
-
getJoinIterator
java.util.Iterator getJoinIterator()
Return the top-levelJoinelements for this select.
-
getStartIndex
long getStartIndex()
The result start index.
-
getEndIndex
long getEndIndex()
The result end index.
-
setRange
void setRange(long start, long end)Set the result range for this select.
-
getColumnAlias
java.lang.String getColumnAlias(Column col)
Return the alias for the given column.
-
getColumnAlias
java.lang.String getColumnAlias(Column col, Joins joins)
Return the alias for the given column.
-
getColumnAlias
java.lang.String getColumnAlias(java.lang.String col, Table table)Return the alias for the given column.
-
getColumnAlias
java.lang.String getColumnAlias(java.lang.String col, Table table, Joins joins)Return the alias for the given column.
-
isAggregate
boolean isAggregate()
Return true if this is an aggregate select.
-
setAggregate
void setAggregate(boolean agg)
Set to true for aggregate selects.
-
isLob
boolean isLob()
Return true if this select includes a LOB.
-
setLob
void setLob(boolean lob)
Set to true for selects that include LOB columns.
-
clearSelects
void clearSelects()
Clear the existing column selects.
-
selectPlaceholder
void selectPlaceholder(java.lang.String sql)
Select the given SQL as a placeholder for a UNION element.
-
select
boolean select(SQLBuffer sql, java.lang.Object id)
Select the given SQL; the given id object is an identifier to use when retrieving the corresponding value from aResult.- Returns:
- true if selected
-
select
boolean select(SQLBuffer sql, java.lang.Object id, Joins joins)
Select the given SQL; the given id object is an identifier to use when retrieving the corresponding value from aResult.- Returns:
- true if selected
-
select
boolean select(java.lang.String sql, java.lang.Object id)Select the given SQL; the given id object is an identifier to use when retrieving the corresponding value from aResult.- Returns:
- true if selected
-
select
boolean select(java.lang.String sql, java.lang.Object id, Joins joins)Select the given SQL; the given id object is an identifier to use when retrieving the corresponding value from aResult.- Returns:
- true if selected
-
select
boolean select(Column col)
Select the given column.- Returns:
- true if selected
-
select
int select(Column[] cols)
Select the given columns.- Returns:
- bit set of indexes of columns that were selected
-
select
int select(Column[] cols, Joins joins)
Select the given columns.- Returns:
- bit set of indexes of columns that were selected
-
select
void select(ClassMapping mapping, int subclasses, JDBCStore store, JDBCFetchConfiguration fetch, int eager)
Select the columns of the given mapping, possibly including subclasses. This method should be called after all where conditions are added in case the given mapping batches other selects.
-
select
void select(ClassMapping mapping, int subclasses, JDBCStore store, JDBCFetchConfiguration fetch, int eager, Joins joins)
Select the columns of the given mapping, possibly including subclasses. This method should be called after all where conditions are added in case the given mapping batches other selects.
-
selectIdentifier
boolean selectIdentifier(Column col)
Select the given column as one that can be used to get a count of distinct matches. It is not necessary to designate distinct identifiers when eagerly traversing the entire result of the select or when not using an LRSSize setting ofcount.- Returns:
- true if selected
-
selectIdentifier
boolean selectIdentifier(Column col, Joins joins)
Select the given column as one that can be used to get a count of distinct matches. It is not necessary to designate distinct identifiers when eagerly traversing the entire result of the select or when not using an LRSSize setting ofcount.- Returns:
- true if selected
-
selectIdentifier
int selectIdentifier(Column[] cols)
Select the given columns as ones that can be used to get a count of distinct matches. It is not necessary to designate distinct identifiers when eagerly traversing the entire result of the select or when not using an LRSSize setting ofcount.- Returns:
- bit set of indexes of columns that were selected
-
selectIdentifier
int selectIdentifier(Column[] cols, Joins joins)
Select the given columns as ones that can be used to get a count of distinct matches. It is not necessary to designate distinct identifiers when eagerly traversing the entire result of the select or when not using an LRSSize setting ofcount.- Returns:
- bit set of indexes of columns that were selected
-
selectIdentifier
void selectIdentifier(ClassMapping mapping, int subclasses, JDBCStore store, JDBCFetchConfiguration fetch, int eager)
Select the columns of the given mapping, possibly including subclasses. This method should be called after all where conditions are added in case the given mapping batches other selects. The primary key columns of the mapping can be used to get a count of distinct matches. It is not necessary to designate distinct identifiers when eagerly traversing the entire result of the select or when not using an LRSSize setting ofcount.
-
selectIdentifier
void selectIdentifier(ClassMapping mapping, int subclasses, JDBCStore store, JDBCFetchConfiguration fetch, int eager, Joins joins)
Select the columns of the given mapping, possibly including subclasses. This method should be called after all where conditions are added in case the given mapping batches other selects. The primary key columns of the mapping can be used to get a count of distinct matches. It is not necessary to designate distinct identifiers when eagerly traversing the entire result of the select or when not using an LRSSize setting ofcount.
-
selectPrimaryKey
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.- Returns:
- bit set of indexes of pk columns that were selected
-
selectPrimaryKey
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.- Returns:
- bit set of indexes of pk columns that were selected
-
clearOrdering
void clearOrdering()
Clear odering conditions.
-
orderByPrimaryKey
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. Optionally selects ordering data if not already selected.
-
orderByPrimaryKey
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. Optionally selects ordering data if not already selected.
-
orderBy
boolean orderBy(Column col, boolean asc, boolean sel)
Order by the given column. Optionally selects ordering data if not already selected.
-
orderBy
boolean orderBy(Column col, boolean asc, Joins joins, boolean sel)
Order by the given column. Optionally selects ordering data if not already selected.
-
orderBy
int orderBy(Column[] cols, boolean asc, boolean sel)
Order by the given columns. Optionally selects ordering data if not already selected.
-
orderBy
int orderBy(Column[] cols, boolean asc, Joins joins, boolean sel)
Order by the given columns. Optionally selects ordering data if not already selected.
-
orderBy
boolean orderBy(SQLBuffer sql, boolean asc, boolean sel, Value selAs)
Add an ORDER BY clause. Optionally selects ordering data if not already selected.
-
orderBy
boolean orderBy(SQLBuffer sql, boolean asc, Joins joins, boolean sel, Value selAs)
Add an ORDER BY clause. Optionally selects ordering data if not already selected.
-
orderBy
boolean orderBy(java.lang.String sql, boolean asc, boolean sel)Add an ORDER BY clause. Optionally selects ordering data if not already selected.
-
orderBy
boolean orderBy(java.lang.String sql, boolean asc, Joins joins, boolean sel)Add an ORDER BY clause. Optionally selects ordering data if not already selected.
-
wherePrimaryKey
void wherePrimaryKey(java.lang.Object oid, ClassMapping mapping, JDBCStore store)Add where conditions setting the mapping's primary key to the given oid values. If the given mapping does not use oid values for its primary key, we will recursively join to its superclass until we find an ancestor that does.
-
whereForeignKey
void whereForeignKey(ForeignKey fk, java.lang.Object oid, ClassMapping mapping, JDBCStore store)
Add where conditions setting the given foreign key to the given oid values.
-
where
void where(Joins joins)
Add the given where conditions.
-
where
void where(SQLBuffer sql)
Add the given where conditions.
-
where
void where(java.lang.String sql)
Add the given where conditions.
-
where
void where(java.lang.String sql, Joins joins)Add the given where conditions.
-
having
void having(SQLBuffer sql)
Add the given having conditions.
-
having
void having(java.lang.String sql)
Add the given having conditions.
-
having
void having(java.lang.String sql, Joins joins)Add the given having conditions.
-
groupBy
void groupBy(Column col)
Group by the given column.
-
groupBy
void groupBy(Column[] cols)
Group by the given columns.
-
groupBy
void groupBy(SQLBuffer sql)
Add a GROUP BY clause.
-
groupBy
void groupBy(java.lang.String sql)
Add a GROUP BY clause.
-
groupBy
void groupBy(java.lang.String sql, Joins joins)Add a GROUP BY clause.
-
groupBy
void groupBy(ClassMapping mapping, int subclasses, JDBCStore store, JDBCFetchConfiguration fetch)
Group by the columns of the given mapping, possibly including subclasses. Assumes EAGER_NONE.
-
groupBy
void groupBy(ClassMapping mapping, int subclasses, JDBCStore store, JDBCFetchConfiguration fetch, Joins joins)
Group by the columns of the given mapping, possibly including subclasses. Assumes EAGER_NONE.
-
whereClone
SelectExecutor whereClone(int sels)
Return a SELECT with the same joins and where conditions as this one.- Parameters:
sels- number of selects to UNION together; ignored if <= 1
-
fullClone
SelectExecutor fullClone(int sels)
Return a SELECT that is a complete clone of this one.- Parameters:
sels- number of selects to UNION together; ignored if <= 1
-
eagerClone
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. If the join type is inner or outer, then this select instance will be returned. Otherwise, the returned select will have a clone of this select's where conditions and joins but will be independent.- Parameters:
key- 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 <= 1
-
getEager
SelectExecutor getEager(FieldMapping key)
Return the eager select for the given key.
-
newJoins
Joins newJoins()
Return a new instance to use for joining.
-
newOuterJoins
Joins newOuterJoins()
Return a new instance to use for outer joining.
-
and
Joins and(Joins joins1, Joins joins2)
AND the given joins together. The given joins will be hollowed in the process.
-
or
Joins or(Joins joins1, Joins joins2)
OR the given joins together. The common joins will be removed in the process.
-
toString
java.lang.String toString()
Implement toString to generate SQL string for profiling/debuggging.- Overrides:
toStringin classjava.lang.Object
-
getColumnAlias
java.lang.String getColumnAlias(Column col, java.lang.Object path)
Return the alias for the given column, without creating new table alias
-
setContext
void setContext(Context context)
Set JPQL query context for this select- Parameters:
context-
-
ctx
Context ctx()
Return the JPQL query context of this select
-
setSchemaAlias
void setSchemaAlias(java.lang.String schemaAlias)
Record the initial schemaAlias of a join path- Parameters:
schemaAlias-
-
setHasSubselect
void setHasSubselect(boolean hasSub)
Set the flag to indicate whether this Select has internally generated subselect
-
getHasSubselect
boolean getHasSubselect()
Return the flag to indicate whether this Select has internally generated subselect
-
logEagerRelations
void logEagerRelations()
Extended trace that logs eager relations
-
setTablePerClassMeta
void setTablePerClassMeta(ClassMapping meta)
Set table-per-class metadata for polymorphic queries
-
getTablePerClassMeta
ClassMapping getTablePerClassMeta()
get table-per-class metadata for polymorphic queries
-
setJoinedTableClassMeta
void setJoinedTableClassMeta(java.util.List meta)
Set joined table metadatas for polymorphic queries
-
getJoinedTableClassMeta
java.util.List getJoinedTableClassMeta()
get joined table metadatas for polymorphic queries
-
setExcludedJoinedTableClassMeta
void setExcludedJoinedTableClassMeta(java.util.List meta)
Set joined table metadatas excluded for polymorphic queries
-
getExcludedJoinedTableClassMeta
java.util.List getExcludedJoinedTableClassMeta()
get joined table metadatas excluded for polymorphic queries
-
getDictionary
DBDictionary getDictionary()
-
-