Skip navigation links
oracle.javatools.db.sql
Class AbstractSQLFragment
java.lang.Object
oracle.javatools.db.AbstractDBObject
oracle.javatools.db.AbstractChildDBObject
oracle.javatools.db.sql.AbstractSQLFragment
- All Implemented Interfaces:
- ChildDBObject, DBObject, SQLFragment, Copyable, DynamicPropertySet
- Direct Known Subclasses:
- AbstractAliasFragment, AbstractFromObjectUsage, AbstractSchemaObjectUsage, AbstractSQLQuery, CaseStatement, CaseStatement.WhenThen, DataMiningFunction.DataMiningArguments, DataMiningFunction.DataMiningCostValues, FKUsage, GroupByObject, HierarchicalQueryObject, IndexObject, JoinObject, ModelObject, ModelObject.CellAssignment, ModelObject.CellReferenceOptions, ModelObject.ModelColumnClauses, ModelObject.ModelRulesCellAssignmentExpr, ModelObject.ModelRulesClause, ModelObject.MultiColumnForLoop, ModelObject.ReferenceModel, ModelObject.SingleColumnForLoop, Operation, OrderByObject, SimpleSQLFragment, UsingJoinCondition, WindowFunction.WindowFunctionBound
-
public abstract class AbstractSQLFragment
- extends AbstractChildDBObject
- implements SQLFragment
Abstract superclass for SQLFragment implementations.
- Since:
- 10.1.3
Fields inherited from interface oracle.javatools.db.sql.SQLFragment |
CONNECTBY, FROM, GROUPBY, HAVING, MODEL, NOCYCLE, ORDERBY, ORDERSIBLINGSBY, PRIOR, SELECT, STARTWITH, TYPE, WHERE |
Method Summary |
protected void |
appendToBuffer(java.lang.StringBuilder query, java.util.Collection objs, java.lang.String indent)
Adds to the given buffer the list of SQLFragments, comma and newline (with indent) seperated. |
protected java.lang.String |
argsToString(java.util.Collection args, boolean commutative, java.lang.String sep, int start)
Returns the arguments as a String, each separated by the given separator. |
java.lang.Integer |
getStartOffset()
If the position of the fragment of SQL within the overall SQL Statement is known, it will be returned here as an Integer zero based offset. |
protected java.lang.String |
getTextOrNull(SQLFragment frag)
Returns the SQLText for the given fragment, or null if the fragment itself is null. |
protected java.lang.String |
getTextOrNull(SQLFragment frag, boolean surroundWithBrackets)
Returns the SQLText for the given fragment, or null if the fragment itself is null. |
java.lang.String |
getType()
Returns the type of this object. |
void |
setParent(DBObject parent)
Sets the parent of this object. |
void |
setStartOffset(java.lang.Integer start)
|
protected java.lang.String |
surroundWithBrackets(java.lang.String text)
Surrounds the given text with brackets. |
protected java.lang.String |
surroundWithBrackets(java.lang.String text, boolean force)
Surrounds the given text with brackets (parentheses). |
java.lang.String |
toString()
|
Methods inherited from class oracle.javatools.db.AbstractDBObject |
changeParent, compareToImpl, copyObject, copyTo, copyTo, copyTo, copyTo, equals, equalsImpl, findOwnedObject, findOwnedObject, findOwnedObject, getChildSupport, getID, getName, getOwnedObjects, getOwnedObjects, getOwnedObjectsImpl, getProperties, getProperty, getReferenceIDs, getReferenceIDsImpl, hashCode, includeOwnedObject, includesType, includesType, removeThisAsParent, replaceReferenceIDs, setID, setName, setProperties |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface oracle.javatools.db.DBObject |
copyTo, copyTo, copyTo, findOwnedObject, findOwnedObject, getID, getName, getOwnedObjects, getOwnedObjects, getReferenceIDs, replaceReferenceIDs, setID, setName |
DEFAULT_SEPARATOR
protected static final java.lang.String DEFAULT_SEPARATOR
-
- See Also:
- Constant Field Values
EMPTY_ARRAY
protected static final SQLFragment[] EMPTY_ARRAY
SPACE
protected static final java.lang.String SPACE
-
- See Also:
- Constant Field Values
EMPTY
protected static final java.lang.String EMPTY
-
- See Also:
- Constant Field Values
NEWLINE
protected static final java.lang.String NEWLINE
-
- See Also:
- Constant Field Values
AbstractSQLFragment
protected AbstractSQLFragment()
getType
public java.lang.String getType()
- Description copied from interface:
DBObject
- Returns the type of this object. Valid types include things like tables, views, synonyms, and columns.
-
- Specified by:
getType
in interface DBObject
-
- Returns:
- a string describing the type of object.
setParent
public void setParent(DBObject parent)
- Description copied from interface:
ChildDBObject
- Sets the parent of this object.
-
- Specified by:
setParent
in interface ChildDBObject
- Overrides:
setParent
in class AbstractChildDBObject
getTextOrNull
protected java.lang.String getTextOrNull(SQLFragment frag)
- Returns the SQLText for the given fragment, or null if the fragment itself is null. If the fragment is a SQLQuery it will automatically be surrounded with parentheses.
-
- Parameters:
frag
- (can be null)
- Returns:
- the sql text or null if the fragment is null
getTextOrNull
protected java.lang.String getTextOrNull(SQLFragment frag,
boolean surroundWithBrackets)
- Returns the SQLText for the given fragment, or null if the fragment itself is null.
-
- Parameters:
frag
- the fragment to get the text for (can be null)
surroundWithBrackets
- whether to surround the fragment with brackets (if the frag is a SQLQuery this will happen anyway).
- Returns:
- the sql text or null if the fragment is null
argsToString
protected java.lang.String argsToString(java.util.Collection args,
boolean commutative,
java.lang.String sep,
int start)
- Returns the arguments as a String, each separated by the given separator.
surroundWithBrackets
protected java.lang.String surroundWithBrackets(java.lang.String text)
- Surrounds the given text with brackets.
surroundWithBrackets
protected java.lang.String surroundWithBrackets(java.lang.String text,
boolean force)
- Surrounds the given text with brackets (parentheses).
-
- Parameters:
text
- the text to surround
force
- whether to force the surround (true), or instead assess whether the text is already surrounded (or contains an even number of sets of brackets) and therefore doesn't need any more (false).
appendToBuffer
protected void appendToBuffer(java.lang.StringBuilder query,
java.util.Collection objs,
java.lang.String indent)
- Adds to the given buffer the list of SQLFragments, comma and newline (with indent) seperated.
toString
public java.lang.String toString()
-
- Overrides:
toString
in class AbstractDBObject
getStartOffset
public java.lang.Integer getStartOffset()
- Description copied from interface:
SQLFragment
- If the position of the fragment of SQL within the overall SQL Statement is known, it will be returned here as an Integer zero based offset. Can return
null
.
-
- Specified by:
getStartOffset
in interface SQLFragment
-
- Returns:
- The position of the fragment within the overall statement or
null
if not known
setStartOffset
public void setStartOffset(java.lang.Integer start)
Skip navigation links
Copyright © 1997, 2012, Oracle. All rights reserved.