Package | Description |
---|---|
oracle.javatools.db.sql |
Contains an API for declaratively parsing SQL queries (SELECT statements).
|
Modifier and Type | Method and Description |
---|---|
FromObject |
SQLQueryBuilder.constructFromObject(java.lang.String expression,
java.lang.String alias)
Creates a FromObject using the given alias and expression, parsing the
expression into an appropriate set of SQLFragments.
|
FromObject |
AbstractSQLQueryBuilder.constructFromObject(java.lang.String expression,
java.lang.String alias) |
protected FromObject |
AbstractSQLQueryBuilder.createFromObject(SchemaObject rel,
java.util.List<java.lang.String> extraNames) |
FromObject |
SQLQueryBuilder.createJoinObject(FKConstraint fk,
FromObject left,
FromObject right)
Creates a FromObject that joins using a JoinCondition matching the given
FK and joins the two from objects.
|
FromObject |
AbstractSQLQueryBuilder.createJoinObject(FKConstraint fk,
FromObject left,
FromObject right) |
protected FromObject |
AbstractSQLQueryBuilder.doConstructFromObject(SchemaObject relation,
java.util.List<DBObjectID> baseRelIDs,
java.util.List<java.lang.String> relNames,
java.util.Map<DBObjectID,FromObject> newRels,
java.util.List<Column> cols,
java.util.List<FKConstraint> fks) |
protected FromObject |
AbstractSQLQueryBuilder.doConstructJoin(FKConstraint fk,
java.util.Map<DBObjectID,FromObject> relsIDsToUse,
java.util.List<FromObject> newFroms,
FromObject left,
FromObject right) |
FromObject |
FromObjectUsage.getFromObject()
Deprecated.
- use resolveFromObject() instead.
|
FromObject |
AbstractFromObjectUsage.getFromObject()
Deprecated.
- use setFromObjectID() instead
|
FromObject |
SQLQueryBuilder.getFromObject(java.lang.String usableAlias)
Returns the from object that can be referenced by this alias.
|
FromObject |
AbstractSQLQueryBuilder.getFromObject(java.lang.String usableAlias) |
FromObject |
AbstractSQLQueryBuilder.getFromObject(java.lang.String usableAlias,
FromObject extrafrom)
Gets a FromObject with the given alias.
|
FromObject[] |
SQLQueryBuilder.SQLQueryObjectSet.getFromObjects() |
FromObject[] |
SQLQuery.getFromObjects()
Get all the from objects for this query.
|
FromObject[] |
DeclarativeSQLQuery.getFromObjects()
Deprecated.
Get all the from objects for this query.
|
FromObject |
JoinObject.getLeftExpression() |
FromObject |
FKUsage.getLeftFromObject()
Deprecated.
- use getLeftFromObjectID or resolveLeftFromObject
|
FromObject |
JoinObject.getRightExpression() |
FromObject |
FKUsage.getRightFromObject()
Deprecated.
- use getRightFromObjectID or resolveRightFromObject
|
FromObject[] |
SQLQueryBuilder.listAllFromObjects()
Returns all FromObjects in the FROM clause including those nested in JOIN
conditions.
|
FromObject[] |
AbstractSQLQueryBuilder.listAllFromObjects() |
FromObject[] |
SQLQueryBuilder.listAllFromObjects(boolean includeJoins)
Returns all FromObjects in the FROM clause including those nested in JOIN
conditions.
|
FromObject[] |
AbstractSQLQueryBuilder.listAllFromObjects(boolean includeJoins) |
FromObject |
FromObjectUsage.resolveFromObject()
Returns the FromObject that this object is dependent on.
|
FromObject |
AbstractFromObjectUsage.resolveFromObject()
Convenience method for resolving the stored FROM object id.
|
protected FromObject |
AbstractFromObjectUsage.resolveFromObject(DBObjectID fromId) |
FromObject |
FKUsage.resolveLeftFromObject()
Resolves the ID for the left From Object of this usage and writes any
DBExceptions to the console -- do not use unless you are happy to
ignore any DBExceptions.
|
FromObject |
FKUsage.resolveRightFromObject()
Resolves the ID for the left From Object of this usage and writes any
DBExceptions to the console -- do not use unless you are happy to
ignore any DBExceptions.
|
Modifier and Type | Method and Description |
---|---|
protected java.util.Map<DBObjectID,FromObject> |
AbstractSQLQueryBuilder.getRelIDs(FromObject[] usagesToUse) |
Modifier and Type | Method and Description |
---|---|
void |
SQLQueryBuilder.addFromObject(FromObject from)
Adds the given FromObject to the query.
|
void |
SQLQuery.addFromObject(FromObject f) |
void |
DeclarativeSQLQuery.addFromObject(FromObject f)
Deprecated.
Add a from object to the end of the list.
|
void |
AbstractSQLQueryBuilder.addFromObject(FromObject from) |
void |
SQLQuery.addFromObject(int index,
FromObject f) |
void |
DeclarativeSQLQuery.addFromObject(int index,
FromObject f)
Deprecated.
Add a from object to the given position in the list.
|
protected void |
AbstractSQLQueryBuilder.addFromObjects(FromObject[] froms) |
protected void |
AbstractSQLQueryBuilder.addJoinObject(FromObject from) |
SQLQueryBuilder.SQLQueryObjectSet |
SQLQueryBuilder.constructFKJoin(FKConstraint fk,
FromObject left,
FromObject right)
Creates a JOIN in the query's FROM clause to represent the given
FKConstraint.
|
SQLQueryBuilder.SQLQueryObjectSet |
AbstractSQLQueryBuilder.constructFKJoin(FKConstraint fk,
FromObject left,
FromObject right) |
SQLQueryBuilder.SQLQueryObjectSet |
SQLQueryBuilder.constructFKJoins(FKConstraint[] fks,
FromObject[] usagesToUse)
Creates a set of nested JOINs in the query's FROM clause to represent each
given FKConstraint.
|
SQLQueryBuilder.SQLQueryObjectSet |
AbstractSQLQueryBuilder.constructFKJoins(FKConstraint[] fks,
FromObject[] usagesToUse) |
SQLQueryBuilder.SQLQueryObjectSet |
SQLQueryBuilder.constructFromObject(SchemaObject relation,
boolean createSelectObjects,
boolean createJoins,
FromObject[] includeInJoins)
Creates a FromObject for the query.
|
SQLQueryBuilder.SQLQueryObjectSet |
AbstractSQLQueryBuilder.constructFromObject(SchemaObject relation,
boolean createSelectObjects,
boolean createJoins,
FromObject[] includeInJoins) |
SQLQueryBuilder.SQLQueryObjectSet |
SQLQueryBuilder.constructFromObjects(Relation[] baseRelations,
boolean createSelectObjects,
boolean createJoins,
FromObject[] includeInJoins)
Creates one or more FromObjects for the query.
|
SQLQueryBuilder.SQLQueryObjectSet |
AbstractSQLQueryBuilder.constructFromObjects(Relation[] baseRelations,
boolean createSelectObjects,
boolean createJoins,
FromObject[] includeInJoins) |
SQLQueryBuilder.SQLQueryObjectSet |
SQLQueryBuilder.constructSelectObject(Column col,
FromObject usageToUse)
Creates a SelectObject for the query based on the column passed in.
|
SQLQueryBuilder.SQLQueryObjectSet |
AbstractSQLQueryBuilder.constructSelectObject(Column col,
FromObject usageToUse) |
SQLQueryBuilder.SQLQueryObjectSet |
SQLQueryBuilder.constructSelectObjects(Column[] baseCols,
FromObject[] usagesToUse)
Creates a set of SelectObjects for the query based on the columns passed in.
|
SQLQueryBuilder.SQLQueryObjectSet |
AbstractSQLQueryBuilder.constructSelectObjects(Column[] baseCols,
FromObject[] usagesToUse) |
protected FKUsage |
AbstractSQLQueryBuilder.createFKUsage(DBObjectID fkID,
FromObject left,
FromObject right) |
FromObject |
SQLQueryBuilder.createJoinObject(FKConstraint fk,
FromObject left,
FromObject right)
Creates a FromObject that joins using a JoinCondition matching the given
FK and joins the two from objects.
|
FromObject |
AbstractSQLQueryBuilder.createJoinObject(FKConstraint fk,
FromObject left,
FromObject right) |
protected SelectObject |
AbstractSQLQueryBuilder.createSelectObject(DBObjectID colId,
FromObject from,
java.lang.String alias) |
protected FromObject |
AbstractSQLQueryBuilder.doConstructJoin(FKConstraint fk,
java.util.Map<DBObjectID,FromObject> relsIDsToUse,
java.util.List<FromObject> newFroms,
FromObject left,
FromObject right) |
protected FromObjectUsage |
AbstractSQLQueryBuilder.findColumnInColumnUsage(java.lang.String colName,
boolean external,
ColumnUsage colu,
FromObject from)
Finds a column in the given ColumnUsage.
|
FromObjectUsage |
AbstractSQLQueryBuilder.findColumnInFromExpression(java.lang.String colName,
boolean external,
SQLFragment exp,
boolean allowDuplicates,
FromObject from,
SQLFragment creating)
Finds a Column of given name in the given FromObject's expression.
|
protected FromObjectUsage |
AbstractSQLQueryBuilder.findColumnInFromObjects(java.lang.String colName,
boolean external,
FromObject[] froms,
boolean allowDuplicates,
boolean enforceInAll,
SQLFragment creating)
Finds a Column of given name amongst the given FromObjects.
|
FromObjectUsage |
AbstractSQLQueryBuilder.findColumnInFromObjects(java.lang.String colName,
boolean external,
SQLFragment creating,
FromObject... extraFroms)
Finds a Column of given name amongst the RelationUsages in the query.
|
ColumnUsage |
AbstractSQLQueryBuilder.findColumnInStarSubQuery(java.lang.String colName,
boolean external,
FromObject from)
The from object is of the form (SELECT * FROM <rel>) <alias>
|
protected FromObjectUsage |
AbstractSQLQueryBuilder.findColumnInTableFunction(java.lang.String colName,
boolean external,
Function func,
FromObject from)
Finds a column in the given TABLE() function call.
|
SQLFragment[] |
SQLQueryBuilder.getDependentObjects(FromObject from)
Returns all objects that are dependent on the given FromObject.
|
SQLFragment[] |
AbstractSQLQueryBuilder.getDependentObjects(FromObject from)
Gets the objects in the query that are dependent on the given from object.
|
FromObject |
AbstractSQLQueryBuilder.getFromObject(java.lang.String usableAlias,
FromObject extrafrom)
Gets a FromObject with the given alias.
|
protected java.util.Map<DBObjectID,FromObject> |
AbstractSQLQueryBuilder.getRelIDs(FromObject[] usagesToUse) |
static Relation |
SQLFragmentUtils.getTable(FromObject from) |
static boolean |
SQLFragmentUtils.hasPKCols(java.util.Collection<java.lang.String> colNames,
FromObject from)
Tests whether the list of columns contains a PK column for the table
referenced by the given given FromObject
|
int |
SQLQuery.indexOf(FromObject f) |
int |
DeclarativeSQLQuery.indexOf(FromObject f)
Deprecated.
Returns the index of the given FromObject in the query's FROM clause,
or -1 if it isn't in the clause.
|
static java.util.Collection<java.lang.String> |
SQLFragmentUtils.listCommonColumns(FromObject left,
FromObject right)
Lists the names of columns common to both FromObjects.
|
void |
SQLQuery.moveFromObject(FromObject f,
int newIndex) |
void |
DeclarativeSQLQuery.moveFromObject(FromObject f,
int newIndex)
Deprecated.
Moves the given FromObject within the query's FROM clause.
|
protected SQLFragment |
AbstractSQLQueryBuilder.parseFromExpression(java.lang.String expression,
FromObject creating) |
boolean |
SQLQueryBuilder.removeFromObject(FromObject obj)
Removes the given FromObject from the SQLQuery.
|
boolean |
SQLQuery.removeFromObject(FromObject f) |
boolean |
DeclarativeSQLQuery.removeFromObject(FromObject f)
Deprecated.
Remove a from object from the list.
|
boolean |
AbstractSQLQueryBuilder.removeFromObject(FromObject obj) |
boolean |
SQLQueryBuilder.removeJoinObject(FromObject obj)
If the expression for the given obj is a JoinObject the join is removed
and the two FromObjects that were joined are added to the top level of
the query.
|
boolean |
AbstractSQLQueryBuilder.removeJoinObject(FromObject obj) |
void |
SQLQueryBuilder.replaceFromObject(FromObject oldFrom,
FromObject newFrom)
Replaces the existing from object with a new one.
|
void |
AbstractSQLQueryBuilder.replaceFromObject(FromObject oldFrom,
FromObject newFrom) |
protected void |
AbstractSQLQueryBuilder.replaceWithAliases(FromObject[] froms)
replace any From Objects in the list that are aliases for
a subquery_factoring_clause
|
void |
FromObjectUsage.setFromObject(FromObject from)
Deprecated.
- use setFromObjectID().
|
void |
AbstractFromObjectUsage.setFromObject(FromObject from)
Deprecated.
- use setFromObjectID() instead
|
void |
SQLQuery.setFromObjects(FromObject[] froms)
Set all the from objects for this query - defining the FROM clause.
|
void |
DeclarativeSQLQuery.setFromObjects(FromObject[] froms)
Deprecated.
Set all the from objects for this query.
|
void |
JoinObject.setLeftExpression(FromObject left) |
void |
FKUsage.setLeftFromObject(FromObject obj)
Deprecated.
- use getLeftFromObjectID or resolveLeftFromObject
|
protected void |
AbstractSQLQueryBuilder.setNewFromObject(DBObject frag,
FromObject oldFrom,
FromObject newFrom) |
void |
JoinObject.setRightExpression(FromObject right) |
void |
FKUsage.setRightFromObject(FromObject obj)
Deprecated.
- use setRightFromObjectID
|
Modifier and Type | Method and Description |
---|---|
protected FKUsage |
AbstractSQLQueryBuilder.doConstructFKUsage(FKConstraint fk,
java.util.Map relsIDsToUse,
java.util.List<FromObject> newFroms) |
protected FromObject |
AbstractSQLQueryBuilder.doConstructFromObject(SchemaObject relation,
java.util.List<DBObjectID> baseRelIDs,
java.util.List<java.lang.String> relNames,
java.util.Map<DBObjectID,FromObject> newRels,
java.util.List<Column> cols,
java.util.List<FKConstraint> fks) |
protected FromObject |
AbstractSQLQueryBuilder.doConstructJoin(FKConstraint fk,
java.util.Map<DBObjectID,FromObject> relsIDsToUse,
java.util.List<FromObject> newFroms,
FromObject left,
FromObject right) |
protected FromObject |
AbstractSQLQueryBuilder.doConstructJoin(FKConstraint fk,
java.util.Map<DBObjectID,FromObject> relsIDsToUse,
java.util.List<FromObject> newFroms,
FromObject left,
FromObject right) |
protected SelectObject |
AbstractSQLQueryBuilder.doConstructSelectObject(Column col,
java.util.Map<DBObjectID,FromObject> relsToUse,
java.util.Map<DBObjectID,FromObject> newRels,
java.util.List<java.lang.String> relNames,
java.util.List<java.lang.String> colNames) |
protected SelectObject |
AbstractSQLQueryBuilder.doConstructSelectObject(Column col,
java.util.Map<DBObjectID,FromObject> relsToUse,
java.util.Map<DBObjectID,FromObject> newRels,
java.util.List<java.lang.String> relNames,
java.util.List<java.lang.String> colNames) |
Constructor and Description |
---|
AbstractFromObjectUsage(FromObject from)
Deprecated.
- use ID based constructor instead
|
AsteriskUsage(FromObject from)
Deprecated.
|
ColumnKeywordUsage(java.lang.String columnName,
FromObject from) |
ColumnUsage(DBObjectID colID,
FromObject from)
Create a ColumnUsage using the given Column ID and FromObject to
reference.
|
JoinObject(FromObject left,
FromObject right,
JoinCondition condition)
Creates a default join for the given FromObjects and condition.
|
JoinObject(FromObject left,
FromObject right,
java.lang.String type,
boolean natural,
JoinCondition condition)
Note: If using existing FromObjects for the left or right parameters, it
is the responsibility of the API user to remove these FromObjects from
the query.
|
SelectObjectUsage(DBObjectID selectID,
FromObject from) |
SelectObjectUsage(SelectObject select,
FromObject from) |