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

E13403-07

oracle.javatools.db.sql
Class AbstractSQLFragment

java.lang.Object
  extended by oracle.javatools.db.AbstractDBObject
      extended by oracle.javatools.db.AbstractChildDBObject
          extended by 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, FKUsage, GroupByObject, HierarchicalQueryObject, IndexObject, JoinObject, Operation, OrderByObject, SimpleSQLFragment, UsingJoinCondition, WindowFunction.WindowFunctionBound

public abstract class AbstractSQLFragment
extends AbstractChildDBObject
implements SQLFragment

Abstract superclass for SQLFragment implementations.

Since:
10.1.3

Nested Class Summary
 
Nested classes/interfaces inherited from class oracle.javatools.db.AbstractDBObject
AbstractDBObject.ChildSupport
 
Field Summary
protected static java.lang.String DEFAULT_SEPARATOR
           
protected static java.lang.String EMPTY
           
protected static SQLFragment[] EMPTY_ARRAY
           
protected static java.lang.String NEWLINE
           
protected static java.lang.String SPACE
           
 
Fields inherited from interface oracle.javatools.db.sql.SQLFragment
CONNECTBY, FROM, GROUPBY, HAVING, NOCYCLE, ORDERBY, SELECT, STARTWITH, TYPE, WHERE
 
Fields inherited from interface oracle.javatools.db.DBObject
COMMENT
 
Constructor Summary
protected AbstractSQLFragment()
           
 
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.
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.
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.AbstractChildDBObject
copyToImpl, findParent, getParent, getProperty, setProperty
 
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.sql.SQLFragment
getSQLText
 
Methods inherited from interface oracle.javatools.db.ChildDBObject
getParent
 
Methods inherited from interface oracle.javatools.db.DBObject
copyTo, copyTo, copyTo, findOwnedObject, findOwnedObject, getID, getName, getOwnedObjects, getOwnedObjects, getReferenceIDs, replaceReferenceIDs, setID, setName
 
Methods inherited from interface oracle.javatools.util.DynamicPropertySet
getProperties, getProperty, getProperty, setProperties, setProperty
 

Field Detail

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
Constructor Detail

AbstractSQLFragment

protected AbstractSQLFragment()
Method Detail

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

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

E13403-07

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