Package org.apache.openjpa.jdbc.sql
Class LogicalUnion
java.lang.Object
org.apache.openjpa.jdbc.sql.LogicalUnion
- All Implemented Interfaces:
- SelectExecutor,- Union
A logical union made up of multiple distinct selects whose results are
 combined in memory.
- Author:
- Abe White
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic interfaceA callback used to create the selects in a SQL union.classA select that is part of a logical union.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected final BitSetprotected final DBDictionaryprotected final ClassMapping[]protected final LogicalUnion.UnionSelect[]
- 
Constructor SummaryConstructorsModifierConstructorDescriptionLogicalUnion(JDBCConfiguration conf, int sels) Constructor.protectedLogicalUnion(JDBCConfiguration conf, int sels, Select[] seeds) Delegate constructor.LogicalUnion(JDBCConfiguration conf, Select[] seeds) Constructor used to seed the internal selects.
- 
Method SummaryModifier and TypeMethodDescriptionvoidForce the use of a series of standard selects rather than a true UNION.execute(JDBCStore store, JDBCFetchConfiguration fetch) Execute this select in the context of the given store manager.execute(JDBCStore store, JDBCFetchConfiguration fetch, int lockLevel) Execute this select in the context of the given store manager.booleanWhether to automatically make results distinct when relational joins would otherwise introduce duplicates.Return the select configuration.intReturn the number of instances matching this select.intThe expected result count for the query.intThe join syntax for this select, as one of the syntax constants fromJoinSyntaxes.Get the union-level ordering, if any.Select[]Return the selects that make up this union.getSQL()Get the buffer if it has been computed by a previous call toSelectExecutor.toSelect(boolean, JDBCFetchConfiguration), if any.booleanAffirm if this receiver requires more than one selects to fetch its data.booleanWhether this is a SELECT DISTINCT / UNION ALL.booleanisLRS()Whether the result of this select should be treated as a large result set.booleanisUnion()Whether this is a true UNION, rather than a logical combination of independent selects.protected LogicalUnion.UnionSelectnewUnionSelect(SelectImpl seed, int pos) Create a new union select with the given delegate and union position.voidselect(Union.Selector selector) Select data using the given selector.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 syntax) 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.booleanWhether this select can be executed for update.booleansupportsRandomAccess(boolean forUpdate) Return whether this select can support a random access result set type.toSelect(boolean forUpdate, JDBCFetchConfiguration fetch) Return this select as a SQL statement formatted for the current dictionary.Return this select as a COUNT SQL statement formatted for the current dictionary.toString()
- 
Field Details- 
sels
- 
dict
- 
mappings
- 
desc
 
- 
- 
Constructor Details- 
LogicalUnionConstructor.- Parameters:
- conf- system configuration
- sels- the number of SQL selects to union together
 
- 
LogicalUnionConstructor used to seed the internal selects.
- 
LogicalUnionDelegate constructor.
 
- 
- 
Method Details- 
newUnionSelectCreate a new union select with the given delegate and union position.
- 
getSelectsDescription copied from interface:UnionReturn the selects that make up this union.- Specified by:
- getSelectsin interface- Union
 
- 
isUnionpublic boolean isUnion()Description copied from interface:UnionWhether this is a true UNION, rather than a logical combination of independent selects.
- 
abortUnionpublic void abortUnion()Description copied from interface:UnionForce the use of a series of standard selects rather than a true UNION.- Specified by:
- abortUnionin interface- Union
 
- 
getOrderingDescription copied from interface:UnionGet the union-level ordering, if any.- Specified by:
- getOrderingin interface- Union
 
- 
getConfigurationDescription copied from interface:SelectExecutorReturn the select configuration.- Specified by:
- getConfigurationin interface- SelectExecutor
 
- 
getDBDictionary
- 
toSelectDescription copied from interface:SelectExecutorReturn this select as a SQL statement formatted for the current dictionary.- Specified by:
- toSelectin interface- SelectExecutor
 
- 
getSQLDescription copied from interface:SelectExecutorGet the buffer if it has been computed by a previous call toSelectExecutor.toSelect(boolean, JDBCFetchConfiguration), if any.- Specified by:
- getSQLin interface- SelectExecutor
 
- 
toSelectCountDescription copied from interface:SelectExecutorReturn this select as a COUNT SQL statement formatted for the current dictionary.- Specified by:
- toSelectCountin interface- SelectExecutor
 
- 
getAutoDistinctpublic boolean getAutoDistinct()Description copied from interface:SelectExecutorWhether to automatically make results distinct when relational joins would otherwise introduce duplicates.- Specified by:
- getAutoDistinctin interface- SelectExecutor
 
- 
setAutoDistinctpublic void setAutoDistinct(boolean distinct) Description copied from interface:SelectExecutorWhether to automatically make results distinct when relational joins would otherwise introduce duplicates.- Specified by:
- setAutoDistinctin interface- SelectExecutor
 
- 
isDistinctpublic boolean isDistinct()Description copied from interface:SelectExecutorWhether this is a SELECT DISTINCT / UNION ALL.- Specified by:
- isDistinctin interface- SelectExecutor
 
- 
setDistinctpublic void setDistinct(boolean distinct) Description copied from interface:SelectExecutorWhether this is a SELECT DISTINCT / UNION ALL.- Specified by:
- setDistinctin interface- SelectExecutor
 
- 
isLRSpublic boolean isLRS()Description copied from interface:SelectExecutorWhether the result of this select should be treated as a large result set.- Specified by:
- isLRSin interface- SelectExecutor
 
- 
setLRSpublic void setLRS(boolean lrs) Description copied from interface:SelectExecutorWhether the result of this select should be treated as a large result set.- Specified by:
- setLRSin interface- SelectExecutor
 
- 
getExpectedResultCountpublic int getExpectedResultCount()Description copied from interface:SelectExecutorThe expected result count for the query.- Specified by:
- getExpectedResultCountin interface- SelectExecutor
 
- 
setExpectedResultCountpublic void setExpectedResultCount(int expectedResultCount, boolean force) Description copied from interface:SelectExecutorThe expected result count for the query.- Specified by:
- setExpectedResultCountin interface- SelectExecutor
- force- if false, the count will be discarded if this select has any to-many eager joins that would throw off the result count
 
- 
getJoinSyntaxpublic int getJoinSyntax()Description copied from interface:SelectExecutorThe join syntax for this select, as one of the syntax constants fromJoinSyntaxes.- Specified by:
- getJoinSyntaxin interface- SelectExecutor
 
- 
setJoinSyntaxpublic void setJoinSyntax(int syntax) Description copied from interface:SelectExecutorThe join syntax for this select, as one of the syntax constants fromJoinSyntaxes.- Specified by:
- setJoinSyntaxin interface- SelectExecutor
 
- 
supportsRandomAccesspublic boolean supportsRandomAccess(boolean forUpdate) Description copied from interface:SelectExecutorReturn whether this select can support a random access result set type.- Specified by:
- supportsRandomAccessin interface- SelectExecutor
 
- 
supportsLockingpublic boolean supportsLocking()Description copied from interface:SelectExecutorWhether this select can be executed for update.- Specified by:
- supportsLockingin interface- SelectExecutor
 
- 
hasMultipleSelectspublic boolean hasMultipleSelects()Description copied from interface:SelectExecutorAffirm if this receiver requires more than one selects to fetch its data.- Specified by:
- hasMultipleSelectsin interface- SelectExecutor
 
- 
getCountDescription copied from interface:SelectExecutorReturn the number of instances matching this select.- Specified by:
- getCountin interface- SelectExecutor
- Throws:
- SQLException
 
- 
executeDescription copied from interface:SelectExecutorExecute this select in the context of the given store manager.- Specified by:
- executein interface- SelectExecutor
- Throws:
- SQLException
 
- 
executepublic Result execute(JDBCStore store, JDBCFetchConfiguration fetch, int lockLevel) throws SQLException Description copied from interface:SelectExecutorExecute this select in the context of the given store manager.- Specified by:
- executein interface- SelectExecutor
- Throws:
- SQLException
 
- 
selectDescription copied from interface:UnionSelect data using the given selector.
- 
toString
 
-