Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-04

oracle.javatools.db.sql
Interface SQLQueryBuilder

All Known Implementing Classes:
AbstractSQLQueryBuilder

public interface SQLQueryBuilder

Interface that defines a builder class for sql queries. A builder is responsible for one SQLQuery, and as long as it is used to perform ALL edit operations on that query will be able to maintain a knowledge of all the Relations and Columns used in that query. If the query is edited without using the builder then the builder's support can no longer be relied upon.

Convention used for method names:

Since:
10.1.3

Nested Class Summary
static interface SQLQueryBuilder.SQLQueryObjectSet
          A result set interface for the query builder class
 
Method Summary
 void addFromObject(FromObject from)
          Adds the given FromObject to the query.
 void addGroupByColumn(FromObjectUsage colu)
          Adds the given FromObjectUsage to the end of the GROUP BY clause.
 void addGroupByColumn(int index, FromObjectUsage colu)
          Adds the given FromObjectUsage to the specified index of the GROUP BY clause.
 void addOrderByObject(int index, OrderByObject ob)
          Adds the given order by object to the given index in the clause.
 void addOrderByObject(OrderByObject ob)
          Adds the given order by object to the end of the order by clause.
 void addSelectObject(int index, SelectObject select)
          Inserts the given SelectObject to the query at the given index.
 void addSelectObject(SelectObject select)
          Adds the given SelectObject to the query.
 void buildQuery(SQLQuery query)
          Builds the query based on the given SQLQuery.
 void buildQuery(java.lang.String select)
          Builds the query based on the given select statement.
 void buildQuery(java.lang.String select, SQLQueryOwner owner)
          Builds the query based on the given select statement.
 boolean canMergeRelationUsages(RelationUsage baseUsage, RelationUsage mergingUsage)
          Determines whether the two RelationUsages are based on the same table.
 boolean canSetGroupBy()
          Returns true if this query can accept a group by clause.
 SQLQueryBuilder.SQLQueryObjectSet constructFKJoin(FKConstraint fk, FromObject left, FromObject right)
          Creates a JOIN in the query's FROM clause to represent the given FKConstraint.
 SQLQueryBuilder.SQLQueryObjectSet constructFKJoins(FKConstraint[] fks, FromObject[] usagesToUse)
          Creates a set of nested JOINs in the query's FROM clause to represent each given FKConstraint.
 SQLQueryBuilder.SQLQueryObjectSet constructFromObject(Relation relation, boolean createSelectObjects, boolean createJoins, FromObject[] includeInJoins)
          Creates a FromObject for the query.
 FromObject 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.
 SQLQueryBuilder.SQLQueryObjectSet constructFromObjects(Relation[] baseRelations, boolean createSelectObjects, boolean createJoins, FromObject[] includeInJoins)
          Creates one or more FromObjects for the query.
 SQLQueryBuilder.SQLQueryObjectSet constructSelectObject(Column col, FromObject usageToUse)
          Creates a SelectObject for the query based on the column passed in.
 SelectObject constructSelectObject(java.lang.String expression, java.lang.String alias)
          Creates a SelectObject using the given alias and expression, parsing the expression into an appropriate set of SQLFragments.
 SQLQueryBuilder.SQLQueryObjectSet constructSelectObjects(Column[] baseCols, FromObject[] usagesToUse)
          Creates a set of SelectObjects for the query based on the columns passed in.
 java.lang.String createUniqueFromAlias(java.lang.String base)
          Takes the given base for an alias and returns an alias that will be unique within this builder's query.
 java.lang.String createUniqueSelectAlias(java.lang.String base)
          Takes the given base for an alias and returns an alias that will be unique within this builder's query.
 FunctionDefinition[] getBuiltInFunctions()
           
 ColumnUsage[] getColumnUsages()
          Returns all the ColumnUsage objects that are present in this query's SELECT and WHERE clauses.
 SQLFragment[] getDependentObjects(FromObject from)
          Returns all objects that are dependent on the given FromObject.
 SQLFragment[] getDependentObjects(SelectObject select)
          Returns all objects that are dependent on the given SelectObject.
 FromObject getFromObject(java.lang.String usableAlias)
          Returns the from object that can be referenced by this alias.
 RelationUsage[] getRelationUsages()
          Returns the RelationUsages found in the SQLQuery.
 SelectObject getSelectObject(java.lang.String usableAlias)
          Returns the select object that can be referenced by this alias.
 AbstractSQLQuery getSQLQuery()
          Returns the query that this builder is working on.
 boolean isUniqueFromAlias(java.lang.String alias)
          Returns true if this alias is unique within the builder's query.
 boolean isUniqueSelectAlias(java.lang.String alias)
          Returns true if this alias is unique within the builder's query.
 FromObject[] listAllFromObjects()
          Returns all FromObjects in the FROM clause including those nested in JOIN conditions.
 FromObject[] listAllFromObjects(boolean includeJoins)
          Returns all FromObjects in the FROM clause including those nested in JOIN conditions.
 FKUsage[] listAvailableFKs()
          Returns all the FKs that could join the relations used in the view wrapped up in an FKUsage so as to include the appropriate FromObjects.
 void mergeRelationUsages(RelationUsage baseUsage, RelationUsage mergingUsage)
          Merges two RelationUsages into one.
 SQLFragment parseFromExpression(java.lang.String expression)
          Parses an expression to see if it is a valid expression for a From object.
 SQLFragment parseHavingExpression(java.lang.String expression)
          Parses an expression to see if it is a valid expression for a Having object.
 OnJoinCondition parseOnExpression(java.lang.String expression, JoinObject join)
          More specific than parseFromExpression() this method is used to specifically parse the ON expression for a JOIN in a FROM clause.
 SQLFragment parseOrderByExpression(java.lang.String expression)
          Parses an expression to see if it is a valid expression for a Order By object.
 SQLFragment parseSelectExpression(java.lang.String expression)
          Parses an expression to see if it is a valid expression for a Select object.
 SQLFragment parseWhereExpression(java.lang.String expression)
          Parses an expression to see if it is a valid expression for a Where object.
 boolean removeFromObject(FromObject obj)
          Removes the given FromObject from the SQLQuery.
 boolean removeGroupByColumn(FromObjectUsage colu)
          Removes the given FromObjectUsage from the GROUP BY clause.
 boolean 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 removeOrderByObject(OrderByObject ob)
          Removes the given order by object from the orderby clause.
 boolean removeSelectObject(SelectObject obj)
          Removes the given SelectObject from the SQLQuery.
 void replaceFromObject(FromObject oldFrom, FromObject newFrom)
          Replaces the existing from object with a new one.
 void replaceOrderByObject(OrderByObject oldOb, OrderByObject newOb)
          Replaces the existing from object with a new one.
 void replaceSelectObject(SelectObject oldSelect, SelectObject newSelect)
          Replaces the existing select object with a new one.
 void setGroupByObject(GroupByObject obj)
          Sets the group by object.
 void setHavingObject(WhereObject having)
          Sets the HAVING clause of the query.
 void setHierarchicalQueryObject(HierarchicalQueryObject having)
          Sets the CONNECT BY clause of the query.
 void setOrderByObjects(OrderByObject[] orderbys)
          Sets the order by objects for the query.
 void setWhereObject(WhereObject where)
          Sets the WhereObject on the query (whilst caching any appropriate dependencies).
 boolean supportsConnectBy()
          Returns whether the given builder flavour supports the Hierarchical Query clause (CONNECT BY) Allows for builders of less featured DBs to restrict the query editing capabilities.
 boolean supportsGroupBy()
          Returns wether the given builder flavour supports the GROUP BY clause.
 boolean supportsOrderBy()
          Returns wether the given builder flavour supports the ORDER BY clause.
 void syncViewColumns()
          If the query is a View query ( @see isViewQuery() ) this syncs the SelectObjects in the query with the Columns in the View.
 void validateQuery()
          Validates a query object to check that its internal structure is correct.
 

Method Detail

getSQLQuery

AbstractSQLQuery getSQLQuery()
Returns the query that this builder is working on.


validateQuery

void validateQuery()
                   throws SQLQueryException
Validates a query object to check that its internal structure is correct. This is only structural (first level) validation.

Throws:
SQLQueryException - if the query fails to validate.

buildQuery

void buildQuery(java.lang.String select)
                throws SQLQueryException
Builds the query based on the given select statement.

Throws:
SQLQueryException - if the query cannot be built.

buildQuery

void buildQuery(java.lang.String select,
                SQLQueryOwner owner)
                throws SQLQueryException
Builds the query based on the given select statement.

Parameters:
the - owner for this query (the query will not be set on the owner).
Throws:
SQLQueryException - if the query cannot be built.

buildQuery

void buildQuery(SQLQuery query)
                throws SQLQueryException
Builds the query based on the given SQLQuery. If the query is non declarative an attempt will be made to create a declarative one instead.

Throws:
SQLQueryException - if the query cannot be built.

parseSelectExpression

SQLFragment parseSelectExpression(java.lang.String expression)
                                  throws SQLQueryException
Parses an expression to see if it is a valid expression for a Select object. If the parse is successful a SQLFragment will be returned for the expression. If the parse isn't successful an appropriate Exception will be thrown.

Parameters:
expression - the sql to parse as a SELECT fragment.
Returns:
SQLFragment for the expression.
Throws:
SQLQueryException

addSelectObject

void addSelectObject(SelectObject select)
                     throws SQLQueryException
Adds the given SelectObject to the query.

Throws:
SQLQueryException

addSelectObject

void addSelectObject(int index,
                     SelectObject select)
                     throws SQLQueryException
Inserts the given SelectObject to the query at the given index.

Throws:
SQLQueryException

isUniqueSelectAlias

boolean isUniqueSelectAlias(java.lang.String alias)
Returns true if this alias is unique within the builder's query.


getSelectObject

SelectObject getSelectObject(java.lang.String usableAlias)
Returns the select object that can be referenced by this alias. It can be the alias of the object, or if the object doesn't have an alias the expression.


getColumnUsages

ColumnUsage[] getColumnUsages()
Returns all the ColumnUsage objects that are present in this query's SELECT and WHERE clauses.


createUniqueSelectAlias

java.lang.String createUniqueSelectAlias(java.lang.String base)
Takes the given base for an alias and returns an alias that will be unique within this builder's query.


constructSelectObject

SelectObject constructSelectObject(java.lang.String expression,
                                   java.lang.String alias)
                                   throws SQLQueryException
Creates a SelectObject using the given alias and expression, parsing the expression into an appropriate set of SQLFragments. The SelectObject created is added to the builder's query, and returned from the method.

Parameters:
expression - the sql for the SelectObject
alias - the alias for the SelectObject
Returns:
the SelectObject that's been added to the query as a result of the operation
Throws:
SQLQueryException

constructSelectObject

SQLQueryBuilder.SQLQueryObjectSet constructSelectObject(Column col,
                                                        FromObject usageToUse)
                                                        throws SQLQueryException
Creates a SelectObject for the query based on the column passed in. A relevant RelationUsage can be provided in the FromObject passed in. If no relevant RelationUsage exists for a the column, a default RelationUsage is created. RelationUsages that already exist in the view are not reused - unless they are in the candidate array. The objects are automatically added to the query.

Parameters:
col - the column to use as the base of the new SelectObject.
usageToUse - A FromObjects in the query that may be used while creating the SelectObject. If null, then a relation usage will be created by default.
Throws:
SQLQueryException - if the select object cannot be built.

constructSelectObjects

SQLQueryBuilder.SQLQueryObjectSet constructSelectObjects(Column[] baseCols,
                                                         FromObject[] usagesToUse)
                                                         throws SQLQueryException
Creates a set of SelectObjects for the query based on the columns passed in. Relevant RelationUsages are taken from the array of candidate usages passed into this method. If no relevant RelationUsage exists for a given column, a default RelationUsage is created. RelationUsages that already exist in the view are not reused - unless they are in the candidate array. The objects are automatically added to the query.

Parameters:
baseCols - An array of columns to be the base columns of the new SelectObjects.
usagesToUse - An array of FromObjects in the query that may be used while creating the SelectObjects. If null, then relation usages will be created by default.
Throws:
SQLQueryException - if the select objects cannot be built.

removeSelectObject

boolean removeSelectObject(SelectObject obj)
Removes the given SelectObject from the SQLQuery. This will cascade to remove all dependent WhereObject fragments.

Parameters:
obj - the SelectObject to remove.
Returns:
true if the remove operation was successful.

replaceSelectObject

void replaceSelectObject(SelectObject oldSelect,
                         SelectObject newSelect)
                         throws SQLQueryException
Replaces the existing select object with a new one. Will remove any dependent parts of the WHERE clauses accordingly.

Throws:
SQLQueryException

getDependentObjects

SQLFragment[] getDependentObjects(SelectObject select)
Returns all objects that are dependent on the given SelectObject. This includes WhereObjects that refer to the SelectObject.

Parameters:
select - the object to get the dependencies for
Returns:
an array of dependent fragments.

parseFromExpression

SQLFragment parseFromExpression(java.lang.String expression)
                                throws SQLQueryException
Parses an expression to see if it is a valid expression for a From object. If the parse is successful a SQLFragment will be returned for the expression. If the parse isn't successful an appropriate Exception will be thrown.

Parameters:
expression - the sql to parse as a FROM fragment.
Returns:
SQLFragment for the expression.
Throws:
SQLQueryException

parseOnExpression

OnJoinCondition parseOnExpression(java.lang.String expression,
                                  JoinObject join)
                                  throws SQLQueryException
More specific than parseFromExpression() this method is used to specifically parse the ON expression for a JOIN in a FROM clause.

Parameters:
expression - the sql to parse as an ON condition
join - the JOIN whose condition we are parsing
Returns:
the parsed condition
Throws:
SQLQueryException

addFromObject

void addFromObject(FromObject from)
                   throws SQLQueryException
Adds the given FromObject to the query.

Throws:
SQLQueryException

isUniqueFromAlias

boolean isUniqueFromAlias(java.lang.String alias)
Returns true if this alias is unique within the builder's query.


listAllFromObjects

FromObject[] listAllFromObjects()
Returns all FromObjects in the FROM clause including those nested in JOIN conditions. This will not return the FromObjects for the JOINS themselves, just those that contain RelationUsages, SQLQuery objects etc.

Returns:

listAllFromObjects

FromObject[] listAllFromObjects(boolean includeJoins)
Returns all FromObjects in the FROM clause including those nested in JOIN conditions. Unless the includeJoins parameter is set to true, this will not return the FromObjects for the JOINS themselves, just those that contain RelationUsages, SQLQuery objects etc.

Parameters:
includeJoins - if set to true, FromObjects for JOINs will be included in the returned array
Returns:

createUniqueFromAlias

java.lang.String createUniqueFromAlias(java.lang.String base)
Takes the given base for an alias and returns an alias that will be unique within this builder's query.


getFromObject

FromObject getFromObject(java.lang.String usableAlias)
Returns the from object that can be referenced by this alias. It can be the alias of the object, or if the object doesn't have an alias the expression.


constructFromObject

FromObject constructFromObject(java.lang.String expression,
                               java.lang.String alias)
                               throws SQLQueryException
Creates a FromObject using the given alias and expression, parsing the expression into an appropriate set of SQLFragments. The FromObject created is added to the builder's query, and returned from the method.

Parameters:
expression - the sql for the FromObject
alias - the alias for the FromObject
Returns:
the FromObject that's been added to the query as a result of the operation
Throws:
SQLQueryException

constructFromObject

SQLQueryBuilder.SQLQueryObjectSet constructFromObject(Relation relation,
                                                      boolean createSelectObjects,
                                                      boolean createJoins,
                                                      FromObject[] includeInJoins)
                                                      throws SQLQueryException
Creates a FromObject for the query. Optionally also creates SelectObjects based on the columns of the relation passed in. Optionally creates WHERE clause joins between the new relation usage based on any foreign keys found between tables in the array. The objects are automatically added to the query.

Parameters:
relation - A table or view from which to create the new RelationUsage.
createSelectObjects - If true, a SelectObject is created for each column in the base relation.
createJoins - If true, a WhereObject is created for each foreign key between tables in the array of relations.
includeInJoins - Whether or not the createJoins parameter is set to true, any foreign key between the base relation of these FromObjects and a relation in the baseRelations parameter causes the relevant WhereObject to be created. This parameter can be null.
Throws:
SQLQueryException - if the from objects cannot be built.

constructFromObjects

SQLQueryBuilder.SQLQueryObjectSet constructFromObjects(Relation[] baseRelations,
                                                       boolean createSelectObjects,
                                                       boolean createJoins,
                                                       FromObject[] includeInJoins)
                                                       throws SQLQueryException
Creates one or more FromObjects for the query. Optionally also creates SelectObjects based on the columns of the relations passed in. Optionally creates WHERE clause joins between the new relation usages based on any foreign keys found between tables in the array. The objects are automatically added to the query.

Parameters:
baseRelations - An array of tables and views from which to create the new RelationUsages.
createSelectObjects - If true, a SelectObject is created for each column in the base relation.
createJoins - If true, a WhereObject is created for each foreign key between tables in the array of relations.
includeInJoins - Whether or not the createJoins parameter is set to true, any foreign key between the base relation of these FromObjects and a relation in the baseRelations parameter causes the relevant WhereObject to be created. This parameter can be null.
Throws:
SQLQueryException - if the from objects cannot be built.

removeJoinObject

boolean 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.


removeFromObject

boolean removeFromObject(FromObject obj)
Removes the given FromObject from the SQLQuery. This will cascade to remove all SelectObject and WhereObject fragments that were dependent on this FromObject.

Parameters:
obj - the FromObject to remove.
Returns:
true if the remove operation was successful.

replaceFromObject

void replaceFromObject(FromObject oldFrom,
                       FromObject newFrom)
                       throws SQLQueryException
Replaces the existing from object with a new one. Will remove any dependent parts of the SELECT and WHERE clauses accordingly.

Throws:
SQLQueryException

getRelationUsages

RelationUsage[] getRelationUsages()
Returns the RelationUsages found in the SQLQuery.

Returns:
the RelationUsages found in the SQLQuery.

getDependentObjects

SQLFragment[] getDependentObjects(FromObject from)
Returns all objects that are dependent on the given FromObject. This includes SelectObjects that refer to the FromObject, and WhereObjects that refer to the FromObject, or its dependent SelectObjects.

In the case of nested objects the top level object will be returned. For example the following SelectObject: NVL(E.COMM, 0) has a nested ColumnUsage which is dependent on the FromObject with alias "E". Calling this method on that FromObject will return the SelectObject, not the nested ColumnUsage.

Parameters:
from - the FromObject to get the dependencies for
Returns:
an array of dependent fragments (SelectObject or WhereObject)

canMergeRelationUsages

boolean canMergeRelationUsages(RelationUsage baseUsage,
                               RelationUsage mergingUsage)
Determines whether the two RelationUsages are based on the same table. A true result indcates that mergeRelationUsages will be valid.

Parameters:
baseUsage - The RelationUsage that will remain and form the basis of the new usage after the merge
mergingUsage - The RelationUsage which will be removed as part of the merge. Any relevant WhereObjects and SelectObjects will be made to reference the new merged usage.
Returns:
true if the relation usages can be merged

mergeRelationUsages

void mergeRelationUsages(RelationUsage baseUsage,
                         RelationUsage mergingUsage)
                         throws SQLQueryException
Merges two RelationUsages into one. The relevant SelectObjects and WhereObjects are updated to use the new alias of the merged RelationUsage. The two usages for the merge must reference the same base relation and be in the same view. The merged RelationUsage is returned and is also added to the query automatically.

Parameters:
baseUsage - The RelationUsage that will remain and form the basis of the new usage after the merge
mergingUsage - The RelationUsage which will be removed as part of the merge. Any relevant WhereObjects and SelectObjects will be made to reference the new merged usage.
Throws:
SQLQueryException - if an error occurs merging the relations.

parseWhereExpression

SQLFragment parseWhereExpression(java.lang.String expression)
                                 throws SQLQueryException
Parses an expression to see if it is a valid expression for a Where object. If the parse is successful a SQLFragment will be returned for the expression. If the parse isn't successful an appropriate Exception will be thrown.

Parameters:
expression - the sql to parse as a WHERE fragment.
Returns:
SQLFragment for the expression.
Throws:
SQLQueryException

constructFKJoin

SQLQueryBuilder.SQLQueryObjectSet constructFKJoin(FKConstraint fk,
                                                  FromObject left,
                                                  FromObject right)
                                                  throws SQLQueryException
Creates a JOIN in the query's FROM clause to represent the given FKConstraint. By default this is an INNER join with an ON clause. If the left or right expressions are provided they will be used without being checked. Be sure to supply them if and only if you know they are the right expressions to be reused. They will be removed from their current parent when joined.

Parameters:
fk - the foreign key constraint to creat a join for
left - the left hand expression for the join to be created.
right - the right hand expression for the join to be created.
Throws:
SQLQueryException

constructFKJoins

SQLQueryBuilder.SQLQueryObjectSet constructFKJoins(FKConstraint[] fks,
                                                   FromObject[] usagesToUse)
                                                   throws SQLQueryException
Creates a set of nested JOINs in the query's FROM clause to represent each given FKConstraint. By default these are an INNER joins. The order of the keys in the array matters - it must reflect the required JOIN heircachy.

Parameters:
fks - the foreign key constraints to creat joins for, in order.
usagesToUse - an array of FromObjects to use for the JOIN. If the relations in question aren't in the array new FromObjects will be created as necessary
Throws:
SQLQueryException

setWhereObject

void setWhereObject(WhereObject where)
Sets the WhereObject on the query (whilst caching any appropriate dependencies).

Parameters:
where - the query's new WhereObject

listAvailableFKs

FKUsage[] listAvailableFKs()
Returns all the FKs that could join the relations used in the view wrapped up in an FKUsage so as to include the appropriate FromObjects.


supportsConnectBy

boolean supportsConnectBy()
Returns whether the given builder flavour supports the Hierarchical Query clause (CONNECT BY) Allows for builders of less featured DBs to restrict the query editing capabilities.


setHierarchicalQueryObject

void setHierarchicalQueryObject(HierarchicalQueryObject having)
Sets the CONNECT BY clause of the query.


supportsGroupBy

boolean supportsGroupBy()
Returns wether the given builder flavour supports the GROUP BY clause. Allows for builders of less featured DBs to restrict the query editing capabilities.


canSetGroupBy

boolean canSetGroupBy()
Returns true if this query can accept a group by clause. To have a group by clause there must be a grouping function in the SELECT clause.


setGroupByObject

void setGroupByObject(GroupByObject obj)
Sets the group by object. This caches any dependent objects against their FromObjects appropriately.


addGroupByColumn

void addGroupByColumn(FromObjectUsage colu)
Adds the given FromObjectUsage to the end of the GROUP BY clause. Will create a GroupByObject if necessary.


addGroupByColumn

void addGroupByColumn(int index,
                      FromObjectUsage colu)
Adds the given FromObjectUsage to the specified index of the GROUP BY clause.


removeGroupByColumn

boolean removeGroupByColumn(FromObjectUsage colu)
Removes the given FromObjectUsage from the GROUP BY clause. Will remove the GROUP BY clause if there are no column usages left.


parseHavingExpression

SQLFragment parseHavingExpression(java.lang.String expression)
                                  throws SQLQueryException
Parses an expression to see if it is a valid expression for a Having object. If the parse is successful a SQLFragment will be returned for the expression. If the parse isn't successful an appropriate Exception will be thrown.

Parameters:
expression - the sql to parse as a HAVING fragment.
Returns:
SQLFragment for the expression.
Throws:
SQLQueryException

setHavingObject

void setHavingObject(WhereObject having)
Sets the HAVING clause of the query. This is for convinience only as the HAVING object is a child of the GroupByObject. This method assumes that a GroupByObject exists on the SQLQuery. This means a NPE will be thrown if you try and set the HAVING clause and no GroupBy has been set.


supportsOrderBy

boolean supportsOrderBy()
Returns wether the given builder flavour supports the ORDER BY clause. Allows for builders of less featured DBs to restrict the query editing capabilities.


parseOrderByExpression

SQLFragment parseOrderByExpression(java.lang.String expression)
                                   throws SQLQueryException
Parses an expression to see if it is a valid expression for a Order By object. If the parse is successful a SQLFragment will be returned for the expression. If the parse isn't successful an appropriate Exception will be thrown.

Parameters:
expression - the sql to parse as a ORDER BY fragment.
Returns:
SQLFragment for the expression.
Throws:
SQLQueryException

addOrderByObject

void addOrderByObject(OrderByObject ob)
Adds the given order by object to the end of the order by clause.


addOrderByObject

void addOrderByObject(int index,
                      OrderByObject ob)
Adds the given order by object to the given index in the clause. If the index is out of bounds the object is added to the end of the clause.


removeOrderByObject

boolean removeOrderByObject(OrderByObject ob)
Removes the given order by object from the orderby clause.


replaceOrderByObject

void replaceOrderByObject(OrderByObject oldOb,
                          OrderByObject newOb)
Replaces the existing from object with a new one. Will recache any dependencies on the FROM clause.


setOrderByObjects

void setOrderByObjects(OrderByObject[] orderbys)
Sets the order by objects for the query. If there are existing objects they are replaced. Passing null will remove all order by objects.


getBuiltInFunctions

FunctionDefinition[] getBuiltInFunctions()

syncViewColumns

void syncViewColumns()
                     throws AliasInUseException
If the query is a View query ( @see isViewQuery() ) this syncs the SelectObjects in the query with the Columns in the View. Any removed SelectObjects will have their Columns removed and any new SelectObjects will have new Columns created.

Throws:
AliasInUseException

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-04

Copyright © 1997, 2010, Oracle. All rights reserved.