Package org.apache.openjpa.jdbc.sql
Interface SelectExecutor
-
- All Known Implementing Classes:
LogicalUnion,LogicalUnion.UnionSelect,SelectImpl
public interface SelectExecutorInterface for configuring and executing a SQL select.- Author:
- Abe White
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Resultexecute(JDBCStore store, JDBCFetchConfiguration fetch)Execute this select in the context of the given store manager.Resultexecute(JDBCStore store, JDBCFetchConfiguration fetch, int lockLevel)Execute this select in the context of the given store manager.booleangetAutoDistinct()Whether to automatically make results distinct when relational joins would otherwise introduce duplicates.JDBCConfigurationgetConfiguration()Return the select configuration.intgetCount(JDBCStore store)Return the number of instances matching this select.intgetExpectedResultCount()The expected result count for the query.intgetJoinSyntax()The join syntax for this select, as one of the syntax constants fromJoinSyntaxes.SQLBuffergetSQL()Get the buffer if it has been computed by a previous call totoSelect(boolean, JDBCFetchConfiguration), if any.booleanhasMultipleSelects()Affirm if this receiver requires more than one selects to fetch its data.booleanisDistinct()Whether this is a SELECT DISTINCT / UNION ALL.booleanisLRS()Whether the result of this select should be treated as a large result set.voidsetAutoDistinct(boolean distinct)Whether to automatically make results distinct when relational joins would otherwise introduce duplicates.voidsetDistinct(boolean distinct)Whether this is a SELECT DISTINCT / UNION ALL.voidsetExpectedResultCount(int expectedResultCount, boolean force)The expected result count for the query.voidsetJoinSyntax(int joinSyntax)The join syntax for this select, as one of the syntax constants fromJoinSyntaxes.voidsetLRS(boolean lrs)Whether the result of this select should be treated as a large result set.booleansupportsLocking()Whether this select can be executed for update.booleansupportsRandomAccess(boolean forUpdate)Return whether this select can support a random access result set type.SQLBuffertoSelect(boolean forUpdate, JDBCFetchConfiguration fetch)Return this select as a SQL statement formatted for the current dictionary.SQLBuffertoSelectCount()Return this select as a COUNT SQL statement formatted for the current dictionary.
-
-
-
Method Detail
-
getConfiguration
JDBCConfiguration getConfiguration()
Return the select configuration.
-
toSelect
SQLBuffer toSelect(boolean forUpdate, JDBCFetchConfiguration fetch)
Return this select as a SQL statement formatted for the current dictionary.
-
getSQL
SQLBuffer getSQL()
Get the buffer if it has been computed by a previous call totoSelect(boolean, JDBCFetchConfiguration), if any.- Since:
- 2.0.0
-
toSelectCount
SQLBuffer toSelectCount()
Return this select as a COUNT SQL statement formatted for the current dictionary.
-
getAutoDistinct
boolean getAutoDistinct()
Whether to automatically make results distinct when relational joins would otherwise introduce duplicates.
-
setAutoDistinct
void setAutoDistinct(boolean distinct)
Whether to automatically make results distinct when relational joins would otherwise introduce duplicates.
-
isDistinct
boolean isDistinct()
Whether this is a SELECT DISTINCT / UNION ALL.
-
setDistinct
void setDistinct(boolean distinct)
Whether this is a SELECT DISTINCT / UNION ALL.
-
isLRS
boolean isLRS()
Whether the result of this select should be treated as a large result set.
-
setLRS
void setLRS(boolean lrs)
Whether the result of this select should be treated as a large result set.
-
getExpectedResultCount
int getExpectedResultCount()
The expected result count for the query.
-
setExpectedResultCount
void setExpectedResultCount(int expectedResultCount, boolean force)The expected result count for the query.- Parameters:
force- if false, the count will be discarded if this select has any to-many eager joins that would throw off the result count
-
getJoinSyntax
int getJoinSyntax()
The join syntax for this select, as one of the syntax constants fromJoinSyntaxes.
-
setJoinSyntax
void setJoinSyntax(int joinSyntax)
The join syntax for this select, as one of the syntax constants fromJoinSyntaxes.
-
supportsRandomAccess
boolean supportsRandomAccess(boolean forUpdate)
Return whether this select can support a random access result set type.
-
supportsLocking
boolean supportsLocking()
Whether this select can be executed for update.
-
getCount
int getCount(JDBCStore store) throws java.sql.SQLException
Return the number of instances matching this select.- Throws:
java.sql.SQLException
-
execute
Result execute(JDBCStore store, JDBCFetchConfiguration fetch) throws java.sql.SQLException
Execute this select in the context of the given store manager.- Throws:
java.sql.SQLException
-
execute
Result execute(JDBCStore store, JDBCFetchConfiguration fetch, int lockLevel) throws java.sql.SQLException
Execute this select in the context of the given store manager.- Throws:
java.sql.SQLException
-
hasMultipleSelects
boolean hasMultipleSelects()
Affirm if this receiver requires more than one selects to fetch its data.- Since:
- 2.0.0
-
-