Package org.datanucleus.store.rdbms.sql
Series of classes used to generate SQL statements. Based around the notion that an SQL statement (SQLStatement) has a series of tables (SQLTable) involved, with a series of joins (SQLJoin), subject to a series of conditions, based on expressions (see org.datanucleus.store.rdbms.sql.expression. The tables involved in the statement can be grouped for convenience to represent objects and relations between objects (like in JDOQL/JPQL). This package has now replaced FetchStatement, and will also replace QueryStatement, StatementText and all code under org.datanucleus.store.mapped.expression.
Provides helpers to generate the SQLStatement. These include
- DiscriminatorStatementGenerator that selects a candidate table and uses the discriminator column of that table (or of its supertable) to identify the returned object
- UnionStatementGenerator that does a UNION of all possible candidates selecting a column "NUCLEUS_TYPE" to identify the object type of the row.
- Numerous methods of SQLStatementHelper to assist in joining between tables of an inheritance tree, and across relations.
Allows control over how tables in the SQL statement are aliased. This uses a plugin-point org.datanucleus.store.rdbms.sql_tablenamer and DataNucleus provides the following options
- alpha-scheme where tables are named using a letter to symbolise their "table-group", followed by a number for the number within that group. So you get names like A0, A1, A2, A3, B0, B1, C0 etc
- t-scheme where tables are named T0, T1, T2, T3, etc
-
Interface Summary Interface Description SelectStatementGenerator Generator of SQL SELECT Statements.SQLTableNamer Interface to be implemented by a class providing naming for SQL tables. -
Class Summary Class Description AbstractSelectStatementGenerator Abstract generator of SQLStatements.DeleteStatement SQL DELETE Statement representation.DiscriminatorStatementGenerator Class to generate a SelectStatement for iterating through instances of a particular type (and optionally subclasses).InsertStatement SQL INSERT Statement representation.SelectStatement SQL SELECT Statement representation.SQLColumn Representation of a column reference in an SQL statement.SQLJoin Representation of a join in an SQL statement.SQLStatement Class providing an API for generating SQL statements.SQLStatementHelper Series of convenience methods to help the process of generating SQLStatements.SQLStatementParameter Representation of an SQLStatement parameter.SQLTable Representation of a table reference in an SQL statement.SQLTableAlphaNamer SQLTable namer that generates names like A0, B1, C0, ...SQLTableGroup Group of tables in an SQL statement.SQLTableNameNamer SQLTable namer that uses the table name as the "alias".SQLTableTNamer SQLTable namer that generates names like T0, T1, T2, etc.SQLText Representation of a snippet of an SQL statement.UnionStatementGenerator Class to generate a SelectStatement for iterating through instances of a particular type (and optionally subclasses).UpdateStatement SQL UPDATE Statement representation. -
Enum Summary Enum Description SQLJoin.JoinType