Package com.github.eikecochu.sqlbuilder
Class Union
- java.lang.Object
-
- com.github.eikecochu.sqlbuilder.QueryPartImpl<Union>
-
- com.github.eikecochu.sqlbuilder.Union
-
- All Implemented Interfaces:
BeforeSelect<Union>,BeforeWith<Union>,QueryPart,QueryPartLinked<Union>,QueryPartSQL<Union>
public class Union extends QueryPartImpl<Union> implements BeforeSelect<Union>, BeforeWith<Union>
The UNION expression. Allows joining two SELECT statements to unify the results. Columns must match.- Author:
- eike
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedUnion(BeforeUnion<?> parent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Unionall()Enable UNION ALL to join all results without removing duplicate results.Unionall(boolean all)Pass true to enable UNION ALL or false to enable UNION.Uniondistinct()Enable UNION to join only distinct results.java.lang.Stringstring(QueryOptions options)Transforms this statement into an SQL string-
Methods inherited from class com.github.eikecochu.sqlbuilder.QueryPartImpl
parent, sql
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.github.eikecochu.sqlbuilder.BeforeSelect
select, select, select, selectSQL
-
Methods inherited from interface com.github.eikecochu.sqlbuilder.BeforeWith
with, with, withSQL
-
Methods inherited from interface com.github.eikecochu.sqlbuilder.QueryPartLinked
ext, parent, parent
-
Methods inherited from interface com.github.eikecochu.sqlbuilder.QueryPartSQL
sql
-
-
-
-
Constructor Detail
-
Union
protected Union(BeforeUnion<?> parent)
-
-
Method Detail
-
all
public Union all()
Enable UNION ALL to join all results without removing duplicate results.- Returns:
- This instance
-
distinct
public Union distinct()
Enable UNION to join only distinct results. Removes duplicate results.- Returns:
- This instance
-
all
public Union all(boolean all)
Pass true to enable UNION ALL or false to enable UNION.- Parameters:
all- True for ALL or false for DISTINCT- Returns:
- This instance
-
string
public java.lang.String string(QueryOptions options)
Description copied from interface:QueryPartTransforms this statement into an SQL string
-
-