Package com.healthmarketscience.sqlbuilder

Builder-style classes for generating a wide variety of SQL statements (see the Syntax Reference for the major highlights).

See:
          Description

Interface Summary
UnaryCondition.CustomUnaryOp Interface which can be implemented to provide a custom unary operation.
Verifiable<ThisType extends Verifiable<ThisType>> Interface for SqlObjects wishing to provide verifiablity.
 

Class Summary
AliasedObject Outputs the given object with a column alias "<obj> AS <alias>".
AlterTableQuery Query which generates an ALTER TABLE statement.
AlterTableQuery.AddColumnAction "Action" for adding a column to a table., e.g.
AlterTableQuery.AddConstraintAction Base "Action" for adding a constraint to a table., e.g.
AlterTableQuery.AddForeignConstraintAction Deprecated. use AddConstraintAction instead
AlterTableQuery.AddPrimaryConstraintAction Deprecated. use AddConstraintAction instead
AlterTableQuery.AddUniqueConstraintAction Deprecated. use AddConstraintAction instead
BaseCaseStatement<ThisType extends BaseCaseStatement<ThisType>> Common base class for "CASE ...
BaseCreateQuery<ThisType extends BaseCreateQuery<ThisType>> Query which generates a CREATE statement.
BaseCTEQuery<ThisType extends BaseCTEQuery<ThisType>> Base class for all queries which support common table expressions (the "WITH " clause).
BaseGrantQuery<ThisType extends BaseGrantQuery<ThisType>> Base of a query which generates a query for manipulating privileges.
BaseGrantQuery.Privilege Encapsulation of a database privilege.
BaseGrantQuery.TargetObject Information about the database object upon which a privilege allows (or disallows) action.
BetweenCondition Outputs a "BETWEEN" condition "(<column> [NOT] BETWEEN (<rightObj1>, <rightObj2>, ...) )"
BinaryCondition Outputs a binary midfix based condition "(<column1> <binaryOp> <column2>)".
BooleanValueObject By default, outputs a boolean value as a number literal, where true == 1 and false == 0.
CaseStatement Outputs a case statement like: "CASE WHEN <cond1> THEN <result1> [ WHEN <cond2> THEN <result2> WHEN ...
CheckConstraintClause Outputs a table or column CHECK constraint like: "[CONSTRAINT <name> ] CHECK (<condition>)"
ComboCondition Outputs combination conditions joined by a given string (AND, OR) "(<cond1> <comboOp> <cond2> <comboOp> <cond3> ...)".
ComboExpression Outputs combination expressions joined by a given mathematical operation (+, -, *, /) or string operation (||) "(<expr1> <exprOp> <expr2> <exprOp> <expr3> ...)".
Comment Generates a comment, e.g.
CommonTableExpression Outputs the Common Table Expression (CTE) definition as part of a "WITH " clause.
Condition An object representing a conditional expression.
ConstraintClause Outputs a table or column constraint clause (depending on the current context) [ CONSTRAINT <name> ] <type> [ (<col1> ...) ].
Converter<SrcType,DstType> Class which encapsulates various object to SqlObject conversions.
CreateIndexQuery Query which generates a CREATE INDEX statement.
CreateTableQuery Query which generates a CREATE TABLE statement.
CreateViewQuery Query which generates a CREATE VIEW statement.
CustomCondition Outputs the given custom object surrounded by parentheses "(<customCond>)".
CustomExpression Outputs the given custom object surrounded by parentheses "(<customExpr>)".
CustomizableSqlObject Base class for all SqlObjects which support SQL syntax customizations.
CustomSql Outputs the given object as is (can be used to insert any custom SQL into a statement).
DeleteQuery Query which generates a DELETE statement.
DropQuery Query which generates a DROP statement.
ExceptQuery Query which generates a series of SELECT queries joined by EXCEPT clauses.
Expression An object representing a value expression.
ExtractExpression Outputs an extract expression like: "EXTRACT(<datePart> FROM <dateExpression>)"
ForeignKeyConstraintClause Outputs a table or column foreign constraint clause (depending on the current context) [ CONSTRAINT <name> ] FOREIGN KEY [ (<col1> ...) ] REFERENCES <refRable> [ (<refCol1> ...) ].
FunctionCall Outputs a function call "<name>([<param1>, ...
GrantQuery Query which generates a GRANT (privileges) statement.
InCondition Outputs an "IN" condition "(<column> [NOT] IN (<rightObj1>, <rightObj2>, ...) )"
InsertQuery Query which generates a simple INSERT statement.
InsertSelectQuery Query which generates an INSERT statement where the data is generated from a SELECT query.
IntersectQuery Query which generates a series of SELECT queries joined by INTERSECT clauses.
JdbcEscape Outputs SQL and a prefix enclosed within JDBC escape syntax "{<prefix> <sql>}".
JdbcScalarFunction Outputs a JDBC escaped scalar function call "{fn <funcCall>}".
NegateExpression Outputs the negation of the given expression "(- <expression>)"
NotCondition Outputs the negation of the given condition "(NOT <condition>)"
NumberValueObject Outputs a number literal <value>.
OrderObject Outputs the given object along with an order specification <obj> <dir>
Query<ThisType extends Query<ThisType>> Base class for all query statements which adds a validation facility.
QueryPreparer Helper class which keeps track of '?' positions in dynamically generated prepared statements so that the query user can easily set the parameters correctly, especially useful where the code which generates the prepared query is separate from the code which uses the prepared query.
QueryPreparer.BooleanStaticPlaceHolder StaticPlaceHolder which calls setInt on the PreparedStatement with the saved value.
QueryPreparer.IntegerStaticPlaceHolder StaticPlaceHolder which calls setInt on the PreparedStatement with the saved value.
QueryPreparer.ListPlaceHolder A SqlObject which outputs 0 or more '?' separated by commas, and records the current indexes at the times the appendTo method is called.
QueryPreparer.LongStaticPlaceHolder StaticPlaceHolder which calls setLong on the PreparedStatement with the saved value.
QueryPreparer.MultiPlaceHolder A SqlObject which outputs a '?', and records the current index at the time(s) the appendTo method is called.
QueryPreparer.NullStaticPlaceHolder StaticPlaceHolder which always calls setNull on the PreparedStatement with the saved sql type.
QueryPreparer.ObjectStaticPlaceHolder<ObjType> StaticPlaceHolder which calls setObject on the PreparedStatement with the saved value.
QueryPreparer.PlaceHolder A SqlObject which outputs a '?', and records the current index at the time the appendTo method is called.
QueryPreparer.StaticPlaceHolder Convenience PlaceHolder which also maintains a value which will always be inserted into the PreparedStatement when setValue is called.
QueryPreparer.StringStaticPlaceHolder StaticPlaceHolder which calls setString on the PreparedStatement with the saved value.
QueryPreparer.TypedStaticPlaceHolder StaticPlaceHolder which calls setObject on the PreparedStatement with the saved value and the saved sql type.
QueryReader Helper class which keeps track of the column positions in dynamically generated select statements so that the query user can easily get the results correctly, especially useful where the code which generates the query is separate from the code which uses the query.
QueryReader.Column A SqlObject which outputs the passed in SqlObject, and records the current index at the time the appendTo method is called.
RevokeQuery Query which generates a REVOKE (privileges) statement.
SelectQuery Query which generates a SELECT statement.
SetOperationQuery<ThisType extends SetOperationQuery<ThisType>> Base query for queries which generate a series of SELECT queries joined by one or more "set operations", such as UNION [ALL], EXCEPT [ALL], and INTERSECT [ALL].
SimpleCaseStatement Outputs a simple case statement like: "CASE <column1> WHEN <val1> THEN <result1> [ WHEN <val2> THEN <result2> WHEN ...
SqlContext Object which maintains context for the sqlbuilder classes when a SQL statement is being generated.
SqlObject Base object which all classes in this facility extend.
SqlObjectList<ObjType extends SqlObject> Maintains a list of SqlObjects.
Subquery Outputs the given query surrounded by parentheses "(<query>)", useful for embedding one query within another.
UnaryCondition Outputs a unary based condition "(<column> <unaryOp>)" or "(<unaryOp> <column>)".
UnionQuery Query which generates a series of SELECT queries joined by UNION clauses.
UpdateQuery Query which generates an UPDATE statement.
ValidationContext Object used to accummulate state during query validation.
ValueObject Outputs a quoted value "'<value>'".
WindowDefinitionClause Outputs a window function clause like: ([PARTITION BY <cols>] [ORDER BY <cols>] [<frameClause>]) Can be used inline on a FunctionCall or via a named reference in a SelectQuery.
WindowDefinitionClause.FrameBound Outputs a bound for the window frame clause.
 

Enum Summary
BaseGrantQuery.Privilege.Type Enumeration representing the various database privilege types
BaseGrantQuery.TargetObject.Type Enumeration representing the types of database objects which have privileges for interacting with them.
BinaryCondition.Op Enum representing the binary midfix operations supported in a SQL condition, e.g.
ComboCondition.Op Enum representing the combo operations supported in a SQL condition, e.g.
ComboExpression.Op Enum representing the combo mathematical operations supported in a SQL expression, e.g.
ConstraintClause.Type Enum representing the types of constraints supported for a column or table.
CreateIndexQuery.Hook The HookAnchors supported for CREATE INDEX queries.
CreateIndexQuery.IndexType Enum which defines the optional index type information.
CreateTableQuery.ColumnConstraint Deprecated. use ConstraintClause instead
CreateTableQuery.Hook The HookAnchors supported for CREATE TABLE queries.
CreateTableQuery.TableType Enum which defines the optional table type information.
DropQuery.Behavior Enum representing additional behavior for the drop query, e.g.: "DROP <type> <obj> <behavior>"
DropQuery.Type Enum representing he type of the object being dropped
ExtractExpression.DatePart The SQL defined date parts for the extract expression.
JdbcEscape.Type Enum which defines the escape types supported.
OrderObject.Dir Enumeration representing the direction of an ordering clause
OrderObject.NullOrder Enumeration representing the order of NULL
SelectQuery.Hook The HookAnchors supported for SELECT queries.
SelectQuery.JoinType Enum which defines the join types supported in a FROM clause.
SetOperationQuery.Type Enumeration representing the type of union to use
UnaryCondition.Op Enum representing the unary operations supported in a SQL condition, e.g.
WindowDefinitionClause.FrameExclusion Outputs the exclusion for the window frame clause.
WindowDefinitionClause.FrameUnits Outputs the units for the window frame clause.
 

Exception Summary
ValidationException Indicates that a sql builder query is not valid.
 

Package com.healthmarketscience.sqlbuilder Description

Builder-style classes for generating a wide variety of SQL statements (see the Syntax Reference for the major highlights).

Package Specification

Syntax Reference

For a list of the major highlights, see the Syntax Reference.

Jdbc Execution Support

Helper classes for executing queries using JDBC.



Copyright © 2006–2017 Health Market Science. All rights reserved.