Class SelectStatement
java.lang.Object
io.github.torand.fastersql.statement.SelectStatement
- All Implemented Interfaces:
Sql
,PreparableStatement
Implements a SELECT statement.
-
Method Summary
Modifier and TypeMethodDescriptionAdds a FOR UPDATE clause.Adds one or columns as groups to the GROUP BY clause.final SelectStatement
having
(OptionalPredicate... maybePredicates) Adds optional predicates to the HAVING clause if the wrapped predicates are present.Adds one or more predicates to the HAVING clause.final SelectStatement
Adds one or more predicates to the HAVING clause, if the condition is true.Adds one or more JOIN clauses.final SelectStatement
Adds one or more JOIN clauses, if the condition is true.leftOuterJoin
(Join join) Adds a LEFT OUTER JOIN clause.limit
(long limit) Adds a LIMIT clause.offset
(long offset) Adds a OFFSET clause.Adds one or more ORDER clauses.Gets the statement parameters introduced by this fragment.rightOuterJoin
(Join join) Adds a RIGHT OUTER JOIN clause.Formats object as an SQL fragment.toString()
final SelectStatement
where
(OptionalPredicate... maybePredicates) Adds optional predicates to the WHERE clause if the wrapped predicates are present.Adds one or more predicates to the WHERE clause.final SelectStatement
Adds supplied predicates to the WHERE clause, if the condition is true.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.github.torand.fastersql.statement.PreparableStatement
aliasRefs, columnRefs, toString
-
Method Details
-
join
Adds one or more JOIN clauses.- Parameters:
joins
- the JOIN clauses.- Returns:
- the modified statement.
-
leftOuterJoin
Adds a LEFT OUTER JOIN clause.- Parameters:
join
- the JOIN clause.- Returns:
- the modified statement.
-
rightOuterJoin
Adds a RIGHT OUTER JOIN clause.- Parameters:
join
- the JOIN clause.- Returns:
- the modified statement.
-
joinIf
@SafeVarargs public final SelectStatement joinIf(boolean condition, Supplier<Join>... joinSuppliers) Adds one or more JOIN clauses, if the condition is true.- Parameters:
condition
- the condition.joinSuppliers
- the suppliers of JOIN clauses.- Returns:
- the modified statement.
-
where
Adds one or more predicates to the WHERE clause.- Parameters:
predicates
- the predicates.- Returns:
- the modified statement.
-
where
Adds optional predicates to the WHERE clause if the wrapped predicates are present.- Parameters:
maybePredicates
- the optional predicates.- Returns:
- the modified statement.
-
whereIf
@SafeVarargs public final SelectStatement whereIf(boolean condition, Supplier<Predicate>... predicateSuppliers) Adds supplied predicates to the WHERE clause, if the condition is true.- Parameters:
condition
- the condition.predicateSuppliers
- the suppliers providing predicates- Returns:
- the modified statement.
-
groupBy
Adds one or columns as groups to the GROUP BY clause.- Parameters:
groups
- the groups- Returns:
- the modified statement.
-
having
Adds one or more predicates to the HAVING clause.- Parameters:
predicates
- the predicates.- Returns:
- the modified statement.
-
having
Adds optional predicates to the HAVING clause if the wrapped predicates are present.- Parameters:
maybePredicates
- the optional predicates.- Returns:
- the modified statement.
-
havingIf
@SafeVarargs public final SelectStatement havingIf(boolean condition, Supplier<Predicate>... predicateSuppliers) Adds one or more predicates to the HAVING clause, if the condition is true.- Parameters:
condition
- the condition.predicateSuppliers
- the suppliers providing predicates.- Returns:
- the modified statement.
-
orderBy
Adds one or more ORDER clauses.- Parameters:
orders
- the ORDER clauses.- Returns:
- the modified statement.
-
limit
Adds a LIMIT clause.- Parameters:
limit
- the limit.- Returns:
- the modified statement.
-
offset
Adds a OFFSET clause.- Parameters:
offset
- the offset.- Returns:
- the modified statement.
-
forUpdate
Adds a FOR UPDATE clause.- Returns:
- the modified statement.
-
sql
Description copied from interface:Sql
Formats object as an SQL fragment. -
params
Description copied from interface:Sql
Gets the statement parameters introduced by this fragment. -
toString
-