|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.7.2) E13403-10 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.javatools.db.sql.AbstractSQLQueryBuilder
public abstract class AbstractSQLQueryBuilder
Abstract implementation of SQLQuery that performs functions generic to any builder.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface oracle.javatools.db.sql.SQLQueryBuilder |
---|
SQLQueryBuilder.SQLQueryObjectSet |
Field Summary | |
---|---|
protected static SQLFragment[] |
EMPTY_ARRAY |
protected Schema |
m_defaultSchema |
protected DBObjectProvider |
m_provider |
protected AbstractSQLQuery |
m_query |
Constructor Summary | |
---|---|
protected |
AbstractSQLQueryBuilder(DBObjectProvider provider, Schema defaultSchema) Construtor |
Method Summary | ||
---|---|---|
void |
addFromObject(FromObject from) Adds the given FromObject to the query. |
|
protected void |
addFromObjects(FromObject[] froms) |
|
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. |
|
protected void |
addJoinObject(FromObject from) |
|
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. |
|
protected void |
addSelectObjects(SelectObject[] selects) |
|
abstract void |
buildQuery(SQLQuery query) Builds the query based on the given SQLQuery. |
|
void |
buildQuery(java.lang.String sql) Builds a query object from the given sql expression. |
|
void |
buildQuery(java.lang.String sql, SQLQueryOwner parent) Builds a query from the given sql expression. |
|
protected abstract void |
buildQueryImpl(java.lang.String sql, SQLQueryOwner parent) 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. |
|
void |
checkUsageQualifications() Checks that every FromObjectUsage which isn't qualified is a unique name within the query. |
|
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. |
|
protected FKUsage |
createFKUsage(DBObjectID fkID, FromObject left, FromObject right) |
|
protected FromObject |
createFromObject(Relation rel, java.util.List extraNames) |
|
protected JoinCondition |
createJoinCondition(FKConstraint fk, JoinObject join) Constructs a condition to represent the given FK for the given join. |
|
FromObject |
createJoinObject(FKConstraint fk, FromObject left, FromObject right) |
|
protected SelectObject |
createSelectObject(DBObjectID colId, FromObject from, java.lang.String alias) |
|
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. |
|
protected java.lang.String |
createUniqueFromAlias(java.lang.String base, java.util.List extraNames) |
|
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. |
|
protected java.lang.String |
createUniqueSelectAlias(java.lang.String base, java.util.List extraNames) |
|
protected FKUsage |
doConstructFKUsage(FKConstraint fk, java.util.Map relsIDsToUse, java.util.List newFroms) |
|
protected FromObject |
doConstructFromObject(Relation relation, java.util.List baseRelIDs, java.util.List relNames, java.util.Map newRels, java.util.List cols, java.util.List fks) |
|
protected FromObject |
doConstructJoin(FKConstraint fk, java.util.Map relsIDsToUse, java.util.List newFroms, FromObject left, FromObject right) |
|
protected SelectObject |
doConstructSelectObject(Column col, java.util.Map relsToUse, java.util.Map newRels, java.util.List relNames, java.util.List colNames) |
|
protected DBObjectID |
ensureID(DBObject s) Only call on an object that has been added to the hierarchy - e.g. |
|
protected void |
ensureIDs(SQLFragment... frags) |
|
protected FromObjectUsage |
findColumnInColumnUsage(java.lang.String colName, ColumnUsage colu, FromObject from) |
|
protected FromObjectUsage |
findColumnInFromExpression(java.lang.String colName, SQLFragment exp, boolean allowDuplicates, FromObject from, SQLFragment creating) |
|
protected FromObjectUsage |
findColumnInFromObjects(java.lang.String colName, FromObject[] froms, boolean allowDuplicates, boolean enforceInAll, SQLFragment creating) Finds a Column of given name amongst the given FromObjects. |
|
protected FromObjectUsage |
findColumnInFromObjects(java.lang.String colName, SQLFragment creating, FromObject... extraFroms) Finds a Column of given name amongst the RelationUsages in the query. |
|
protected FromObjectUsage |
findColumnInJoin(java.lang.String colName, JoinObject join, boolean allowDuplicates, SQLFragment creating) |
|
protected FromObjectUsage |
findColumnInRelation(java.lang.String colName, Relation rel) Warning: The returned ColumnUsage won't have a FromObject set. |
|
protected FromObjectUsage |
findColumnInRelation(java.lang.String colName, RelationUsage relU) |
|
protected SelectObjectUsage |
findColumnInSubQuery(java.lang.String colName, SQLQuery query) |
|
ColumnUsage[] |
getColumnUsages() Returns all the ColumnUsage objects that are present in this query's SELECT and WHERE clauses. |
|
SQLFragment[] |
getDependentObjects(FromObject from) Gets the objects in the query that are dependent on the given from object. |
|
SQLFragment[] |
getDependentObjects(SelectObject select) Gets the objects in the query that are dependent on the given select object. |
|
protected java.lang.String |
getExternalName(java.lang.String name) |
|
FromObject |
getFromObject(java.lang.String usableAlias) Returns the from object that can be referenced by this alias. |
|
protected FromObject |
getFromObject(java.lang.String usableAlias, FromObject extrafrom) Gets a FromObject with the given alias. |
|
protected java.util.List |
getIDs(DBObject[] objs) |
|
protected java.lang.String |
getInternalName(java.lang.String name) |
|
protected SchemaObject |
getObject(java.lang.String type, Schema sch, java.lang.String relation) |
|
RelationUsage[] |
getRelationUsages() Returns the RelationUsages found in the SQLQuery. |
|
protected java.util.Map |
getRelIDs(FromObject[] usagesToUse) |
|
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. |
|
protected boolean |
isUniqueFromAlias(java.lang.String alias, java.util.List extraNames) |
|
boolean |
isUniqueSelectAlias(java.lang.String alias) Returns true if this alias is unique within the builder's query. |
|
protected boolean |
isUniqueSelectAlias(java.lang.String alias, java.util.List extraNames) |
|
protected boolean |
isValidName(java.lang.String type, java.lang.String name) |
|
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. |
|
protected void |
loadObject(DBObject frag) Load the given object (i.e. |
|
protected void |
loadObjects(DBObject[] frags) |
|
protected void |
loadQuery() |
|
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. |
|
protected abstract SQLFragment |
parseFromExpression(java.lang.String expression, FromObject creating) |
|
SQLFragment |
parseHavingExpression(java.lang.String expression) By default this calls parseWhereExpression(). |
|
SQLFragment |
parseOrderByExpression(java.lang.String expression) By default this calls parseSelectExpression(). |
|
SQLFragment |
parseSelectExpression(java.lang.String expression) Parses an expression to see if it is a valid expression for a Select object. |
|
protected abstract SQLFragment |
parseSelectExpression(java.lang.String expression, SelectObject creating) |
|
SQLFragment |
parseWhereExpression(java.lang.String expression) Parses an expression to see if it is a valid expression for a Where object. |
|
abstract SQLFragment |
parseWhereExpression(java.lang.String expression, WhereObject creating) |
|
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. |
|
protected boolean |
removeWhereObject(SQLFragment obj) Removes a top level WhereObject from the WHERE clause. |
|
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 obj) Sets the CONNECT BY clause of the query. |
|
protected void |
setNewFromObject(DBObject frag, FromObject oldFrom, FromObject newFrom) |
|
void |
setOrderByObjects(OrderByObject[] orderbys) Sets the order by objects for the query. |
|
void |
setSingleRelation(Relation singleRelation) |
|
protected void |
setViewColDataType(ViewColumn col) |
|
void |
setWhereObject(WhereObject obj) Sets the WhereObject on the query (whilst caching any appropriate dependencies). |
|
void |
syncViewColumns() If the query is a View query ( @see isViewQuery() ) this syncs the SelectObjects in the query with the Columns in the View. |
|
protected
|
throwException(T sqe) |
|
protected void |
unloadObject(DBObject frag) |
|
void |
validateQuery() Validates a query object to check that its internal structure is correct. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface oracle.javatools.db.sql.SQLQueryBuilder |
---|
getBuiltInFunctions, parseOnExpression, supportsConnectBy, supportsGroupBy, supportsOrderBy |
Field Detail |
---|
protected static final SQLFragment[] EMPTY_ARRAY
protected AbstractSQLQuery m_query
protected DBObjectProvider m_provider
protected Schema m_defaultSchema
Constructor Detail |
---|
protected AbstractSQLQueryBuilder(DBObjectProvider provider, Schema defaultSchema)
Method Detail |
---|
public final void buildQuery(java.lang.String sql) throws SQLQueryException
buildQuery
in interface SQLQueryBuilder
SQLQueryException
- if the query cannot be built.public final void buildQuery(java.lang.String sql, SQLQueryOwner parent) throws SQLQueryException
buildQuery
in interface SQLQueryBuilder
SQLQueryException
- if the query cannot be built.protected abstract void buildQueryImpl(java.lang.String sql, SQLQueryOwner parent) throws SQLQueryException
SQLQueryException
- if the query cannot be built.public abstract void buildQuery(SQLQuery query) throws SQLQueryException
buildQuery
in interface SQLQueryBuilder
SQLQueryException
- if the query cannot be built.protected <T extends SQLQueryException> void throwException(T sqe) throws T extends SQLQueryException
T extends SQLQueryException
public void validateQuery() throws SQLQueryException
SQLQueryBuilder
validateQuery
in interface SQLQueryBuilder
SQLQueryException
- if the query fails to validate.protected final void loadQuery() throws SQLQueryException
SQLQueryException
protected void ensureIDs(SQLFragment... frags)
ensureID(DBObject)
protected DBObjectID ensureID(DBObject s)
protected void loadObjects(DBObject[] frags)
protected void loadObject(DBObject frag)
protected void unloadObject(DBObject frag)
protected java.util.List getIDs(DBObject[] objs) throws SQLQueryException
SQLQueryException
protected java.util.Map getRelIDs(FromObject[] usagesToUse)
protected void setNewFromObject(DBObject frag, FromObject oldFrom, FromObject newFrom)
protected java.lang.String getInternalName(java.lang.String name)
protected java.lang.String getExternalName(java.lang.String name)
protected boolean isValidName(java.lang.String type, java.lang.String name)
public AbstractSQLQuery getSQLQuery()
SQLQueryBuilder
getSQLQuery
in interface SQLQueryBuilder
public void addSelectObject(SelectObject select) throws SQLQueryException
SQLQueryBuilder
addSelectObject
in interface SQLQueryBuilder
SQLQueryException
public void addSelectObject(int index, SelectObject select) throws SQLQueryException
SQLQueryBuilder
addSelectObject
in interface SQLQueryBuilder
SQLQueryException
public boolean isUniqueSelectAlias(java.lang.String alias)
SQLQueryBuilder
isUniqueSelectAlias
in interface SQLQueryBuilder
protected boolean isUniqueSelectAlias(java.lang.String alias, java.util.List extraNames)
public java.lang.String createUniqueSelectAlias(java.lang.String base)
SQLQueryBuilder
createUniqueSelectAlias
in interface SQLQueryBuilder
protected java.lang.String createUniqueSelectAlias(java.lang.String base, java.util.List extraNames)
public SelectObject getSelectObject(java.lang.String usableAlias)
SQLQueryBuilder
getSelectObject
in interface SQLQueryBuilder
public SelectObject constructSelectObject(java.lang.String expression, java.lang.String alias) throws SQLQueryException
SQLQueryBuilder
constructSelectObject
in interface SQLQueryBuilder
expression
- the sql for the SelectObjectalias
- the alias for the SelectObjectSQLQueryException
public SQLQueryBuilder.SQLQueryObjectSet constructSelectObject(Column col, FromObject usageToUse) throws SQLQueryException
SQLQueryBuilder
constructSelectObject
in interface SQLQueryBuilder
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.SQLQueryException
- if the select object cannot be built.public SQLQueryBuilder.SQLQueryObjectSet constructSelectObjects(Column[] baseCols, FromObject[] usagesToUse) throws SQLQueryException
SQLQueryBuilder
constructSelectObjects
in interface SQLQueryBuilder
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.SQLQueryException
- if the select objects cannot be built.protected SelectObject doConstructSelectObject(Column col, java.util.Map relsToUse, java.util.Map newRels, java.util.List relNames, java.util.List colNames) throws SQLQueryException
SQLQueryException
protected SelectObject createSelectObject(DBObjectID colId, FromObject from, java.lang.String alias)
protected void addSelectObjects(SelectObject[] selects)
public boolean removeSelectObject(SelectObject obj)
SQLQueryBuilder
removeSelectObject
in interface SQLQueryBuilder
obj
- the SelectObject to remove.public void replaceSelectObject(SelectObject oldSelect, SelectObject newSelect) throws SQLQueryException
SQLQueryBuilder
replaceSelectObject
in interface SQLQueryBuilder
SQLQueryException
public boolean isUniqueFromAlias(java.lang.String alias)
SQLQueryBuilder
isUniqueFromAlias
in interface SQLQueryBuilder
protected boolean isUniqueFromAlias(java.lang.String alias, java.util.List extraNames)
public java.lang.String createUniqueFromAlias(java.lang.String base)
SQLQueryBuilder
createUniqueFromAlias
in interface SQLQueryBuilder
protected java.lang.String createUniqueFromAlias(java.lang.String base, java.util.List extraNames)
public FromObject[] listAllFromObjects()
SQLQueryBuilder
listAllFromObjects
in interface SQLQueryBuilder
public FromObject[] listAllFromObjects(boolean includeJoins)
SQLQueryBuilder
listAllFromObjects
in interface SQLQueryBuilder
includeJoins
- if set to true, FromObjects for JOINs will be included in the returned arraypublic FromObject getFromObject(java.lang.String usableAlias)
SQLQueryBuilder
getFromObject
in interface SQLQueryBuilder
protected FromObject getFromObject(java.lang.String usableAlias, FromObject extrafrom)
public FromObject constructFromObject(java.lang.String expression, java.lang.String alias) throws SQLQueryException
SQLQueryBuilder
constructFromObject
in interface SQLQueryBuilder
expression
- the sql for the FromObjectalias
- the alias for the FromObjectSQLQueryException
protected FromObject createFromObject(Relation rel, java.util.List extraNames) throws SQLQueryException
SQLQueryException
public SQLQueryBuilder.SQLQueryObjectSet constructFromObject(Relation relation, boolean createSelectObjects, boolean createJoins, FromObject[] includeInJoins) throws SQLQueryException
SQLQueryBuilder
constructFromObject
in interface SQLQueryBuilder
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.SQLQueryException
- if the from objects cannot be built.protected FromObject doConstructFromObject(Relation relation, java.util.List baseRelIDs, java.util.List relNames, java.util.Map newRels, java.util.List cols, java.util.List fks) throws SQLQueryException
SQLQueryException
public SQLQueryBuilder.SQLQueryObjectSet constructFromObjects(Relation[] baseRelations, boolean createSelectObjects, boolean createJoins, FromObject[] includeInJoins) throws SQLQueryException
SQLQueryBuilder
constructFromObjects
in interface SQLQueryBuilder
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.SQLQueryException
- if the from objects cannot be built.public void addFromObject(FromObject from) throws SQLQueryException
SQLQueryBuilder
addFromObject
in interface SQLQueryBuilder
SQLQueryException
protected void addFromObjects(FromObject[] froms)
protected void addJoinObject(FromObject from)
public void replaceFromObject(FromObject oldFrom, FromObject newFrom) throws SQLQueryException
SQLQueryBuilder
replaceFromObject
in interface SQLQueryBuilder
SQLQueryException
public boolean removeJoinObject(FromObject obj)
SQLQueryBuilder
removeJoinObject
in interface SQLQueryBuilder
public boolean removeFromObject(FromObject obj)
SQLQueryBuilder
removeFromObject
in interface SQLQueryBuilder
obj
- the FromObject to remove.public SQLQueryBuilder.SQLQueryObjectSet constructFKJoin(FKConstraint fk, FromObject left, FromObject right) throws SQLQueryException
SQLQueryBuilder
constructFKJoin
in interface SQLQueryBuilder
fk
- the foreign key constraint to creat a join forleft
- the left hand expression for the join to be created.right
- the right hand expression for the join to be created.SQLQueryException
public SQLQueryBuilder.SQLQueryObjectSet constructFKJoins(FKConstraint[] fks, FromObject[] usagesToUse) throws SQLQueryException
SQLQueryBuilder
constructFKJoins
in interface SQLQueryBuilder
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 necessarySQLQueryException
protected FromObject doConstructJoin(FKConstraint fk, java.util.Map relsIDsToUse, java.util.List newFroms, FromObject left, FromObject right) throws SQLQueryException
SQLQueryException
public FromObject createJoinObject(FKConstraint fk, FromObject left, FromObject right) throws SQLQueryException
SQLQueryException
protected JoinCondition createJoinCondition(FKConstraint fk, JoinObject join)
protected FKUsage doConstructFKUsage(FKConstraint fk, java.util.Map relsIDsToUse, java.util.List newFroms) throws SQLQueryException
SQLQueryException
protected FKUsage createFKUsage(DBObjectID fkID, FromObject left, FromObject right)
public void setWhereObject(WhereObject obj)
SQLQueryBuilder
setWhereObject
in interface SQLQueryBuilder
obj
- the query's new WhereObjectprotected boolean removeWhereObject(SQLFragment obj)
public RelationUsage[] getRelationUsages()
SQLQueryBuilder
getRelationUsages
in interface SQLQueryBuilder
public SQLFragment[] getDependentObjects(FromObject from)
getDependentObjects
in interface SQLQueryBuilder
from
- the FromObject to get the dependencies forpublic SQLFragment[] getDependentObjects(SelectObject select)
getDependentObjects
in interface SQLQueryBuilder
select
- the object to get the dependencies forpublic boolean canMergeRelationUsages(RelationUsage baseUsage, RelationUsage mergingUsage)
SQLQueryBuilder
canMergeRelationUsages
in interface SQLQueryBuilder
baseUsage
- The RelationUsage that will remain and form the basis of the new usage after the mergemergingUsage
- 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.public void mergeRelationUsages(RelationUsage baseUsage, RelationUsage mergingUsage) throws SQLQueryException
SQLQueryBuilder
mergeRelationUsages
in interface SQLQueryBuilder
baseUsage
- The RelationUsage that will remain and form the basis of the new usage after the mergemergingUsage
- 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.SQLQueryException
- if an error occurs merging the relations.public FKUsage[] listAvailableFKs()
SQLQueryBuilder
listAvailableFKs
in interface SQLQueryBuilder
public ColumnUsage[] getColumnUsages()
SQLQueryBuilder
getColumnUsages
in interface SQLQueryBuilder
protected FromObjectUsage findColumnInFromObjects(java.lang.String colName, SQLFragment creating, FromObject... extraFroms) throws SQLQueryException
SQLQueryException
protected FromObjectUsage findColumnInFromObjects(java.lang.String colName, FromObject[] froms, boolean allowDuplicates, boolean enforceInAll, SQLFragment creating) throws SQLQueryException
SQLQueryException
protected FromObjectUsage findColumnInFromExpression(java.lang.String colName, SQLFragment exp, boolean allowDuplicates, FromObject from, SQLFragment creating) throws SQLQueryException
SQLQueryException
protected FromObjectUsage findColumnInColumnUsage(java.lang.String colName, ColumnUsage colu, FromObject from)
protected FromObjectUsage findColumnInJoin(java.lang.String colName, JoinObject join, boolean allowDuplicates, SQLFragment creating) throws SQLQueryException
SQLQueryException
protected FromObjectUsage findColumnInRelation(java.lang.String colName, RelationUsage relU) throws SQLQueryException
SQLQueryException
protected FromObjectUsage findColumnInRelation(java.lang.String colName, Relation rel) throws SQLQueryException
SQLQueryException
protected SelectObjectUsage findColumnInSubQuery(java.lang.String colName, SQLQuery query) throws SQLQueryException
SQLQueryException
public void setHierarchicalQueryObject(HierarchicalQueryObject obj)
SQLQueryBuilder
setHierarchicalQueryObject
in interface SQLQueryBuilder
public void setGroupByObject(GroupByObject obj)
SQLQueryBuilder
setGroupByObject
in interface SQLQueryBuilder
public boolean canSetGroupBy()
SQLQueryBuilder
canSetGroupBy
in interface SQLQueryBuilder
public void addGroupByColumn(FromObjectUsage colu)
SQLQueryBuilder
addGroupByColumn
in interface SQLQueryBuilder
public void addGroupByColumn(int index, FromObjectUsage colu)
SQLQueryBuilder
addGroupByColumn
in interface SQLQueryBuilder
public boolean removeGroupByColumn(FromObjectUsage colu)
SQLQueryBuilder
removeGroupByColumn
in interface SQLQueryBuilder
public SQLFragment parseHavingExpression(java.lang.String expression) throws SQLQueryException
parseHavingExpression
in interface SQLQueryBuilder
expression
- the sql to parse as a HAVING fragment.SQLQueryException
public SQLFragment parseOrderByExpression(java.lang.String expression) throws SQLQueryException
parseOrderByExpression
in interface SQLQueryBuilder
expression
- the sql to parse as a ORDER BY fragment.SQLQueryException
public void setHavingObject(WhereObject having)
SQLQueryBuilder
setHavingObject
in interface SQLQueryBuilder
public void addOrderByObject(OrderByObject ob)
SQLQueryBuilder
addOrderByObject
in interface SQLQueryBuilder
public void addOrderByObject(int index, OrderByObject ob)
SQLQueryBuilder
addOrderByObject
in interface SQLQueryBuilder
public boolean removeOrderByObject(OrderByObject ob)
SQLQueryBuilder
removeOrderByObject
in interface SQLQueryBuilder
public void replaceOrderByObject(OrderByObject oldOb, OrderByObject newOb)
SQLQueryBuilder
replaceOrderByObject
in interface SQLQueryBuilder
public void setOrderByObjects(OrderByObject[] orderbys)
SQLQueryBuilder
setOrderByObjects
in interface SQLQueryBuilder
public void syncViewColumns() throws AliasInUseException
SQLQueryBuilder
syncViewColumns
in interface SQLQueryBuilder
AliasInUseException
public void checkUsageQualifications()
public final SQLFragment parseFromExpression(java.lang.String expression) throws SQLQueryException
SQLQueryBuilder
parseFromExpression
in interface SQLQueryBuilder
expression
- the sql to parse as a FROM fragment.SQLQueryException
protected abstract SQLFragment parseFromExpression(java.lang.String expression, FromObject creating) throws SQLQueryException
SQLQueryException
public final SQLFragment parseSelectExpression(java.lang.String expression) throws SQLQueryException
SQLQueryBuilder
parseSelectExpression
in interface SQLQueryBuilder
expression
- the sql to parse as a SELECT fragment.SQLQueryException
protected abstract SQLFragment parseSelectExpression(java.lang.String expression, SelectObject creating) throws SQLQueryException
SQLQueryException
public final SQLFragment parseWhereExpression(java.lang.String expression) throws SQLQueryException
SQLQueryBuilder
parseWhereExpression
in interface SQLQueryBuilder
expression
- the sql to parse as a WHERE fragment.SQLQueryException
public abstract SQLFragment parseWhereExpression(java.lang.String expression, WhereObject creating) throws SQLQueryException
SQLQueryException
protected void setViewColDataType(ViewColumn col)
public void setSingleRelation(Relation singleRelation)
protected SchemaObject getObject(java.lang.String type, Schema sch, java.lang.String relation) throws DBException
DBException
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.7.2) E13403-10 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |