Extension SDK 10.1.3.36.73

oracle.javatools.db.sql
Class AbstractSQLFragment

java.lang.Object
  extended byoracle.javatools.db.AbstractDBObject
      extended byoracle.javatools.db.sql.AbstractSQLFragment
All Implemented Interfaces:
Copyable, DBObject, DynamicPropertySet, SQLFragment
Direct Known Subclasses:
AbstractAliasFragment, AbstractFromObjectUsage, AbstractSchemaObjectUsage, AbstractSQLQuery, CaseStatement, CaseStatement.WhenThen, FKUsage, GroupByObject, IndexObject, JoinObject, Operation, OrderByObject, SimpleSQLFragment, UsingJoinCondition

public abstract class AbstractSQLFragment
extends AbstractDBObject
implements SQLFragment

Abstract superclass for SQLFragment implementations.

Since:
10.1.3

Field Summary
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
FROM, GROUPBY, HAVING, ORDERBY, SELECT, TYPE, WHERE
 
Fields inherited from interface oracle.javatools.db.DBObject
COMMENT
 
Constructor Summary
protected AbstractSQLFragment()
           
 
Method Summary
protected  void appendToBuffer(java.lang.StringBuffer query, java.util.List objs, java.lang.String indent)
          Adds to the given buffer the list of SQLFragments, comma and newline (with indent) seperated.
protected  void changeParent(SQLFragment oldExp, SQLFragment newExp)
          Changes the parent for the newExp replacing the oldExp in a child slot on this object.
protected  void copyList(java.util.List source, java.util.List target)
           
protected  void copyList(java.util.List source, java.util.List target, DBObject newParent)
           
 SQLFragment[] getChildren()
          Deprecated. use getOwnedObjects()
 DBObject getParent()
          Returns the parent fragment in the query model.
protected  java.lang.String getTextOrNull(SQLFragment frag)
           
 java.lang.String getType()
          Returns the type of this object.
 int hashCode()
           
protected  void removeParent(SQLFragment frag)
          Sets the parent to null on frag if the current parent matches this object.
 void setParent(DBObject parent)
          Sets the parent fragment to this fragment.
protected  void setParents(java.util.List sqlFrags, DBObject parent)
          Sets the given parent on each SQLFragment in the given List.
 java.lang.String toString()
           
 
Methods inherited from class oracle.javatools.db.AbstractDBObject
compareToImpl, copyToImpl, equalsImpl, findOwnedObject, getID, getName, getOwnedObjects, getOwnedObjects, getOwnedObjectsImpl, getProperties, getProperty, getProperty, getReferenceIDs, getReferenceIDsImpl, replaceReferenceIDs, setID, setName, setProperties, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface oracle.javatools.db.sql.SQLFragment
getSQLText
 
Methods inherited from interface oracle.javatools.db.DBObject
copyTo, findOwnedObject, getID, getName, getOwnedObjects, getOwnedObjects, getReferenceIDs, replaceReferenceIDs, setID, setName
 
Methods inherited from interface oracle.javatools.util.DynamicPropertySet
getProperties, getProperty, getProperty, setProperties, setProperty
 

Field Detail

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.

getParent

public DBObject getParent()
Description copied from interface: SQLFragment
Returns the parent fragment in the query model.

Specified by:
getParent in interface SQLFragment

setParent

public void setParent(DBObject parent)
Description copied from interface: SQLFragment
Sets the parent fragment to this fragment. A fragment can only have one parent, calling this will overwrite the existing parent. Use copyTo() to create duplicate fragments if the same expression is needed under more than one parent.

Specified by:
setParent in interface SQLFragment

changeParent

protected void changeParent(SQLFragment oldExp,
                            SQLFragment newExp)
Changes the parent for the newExp replacing the oldExp in a child slot on this object. Either newExp or oldExp can be null.


removeParent

protected void removeParent(SQLFragment frag)
Sets the parent to null on frag if the current parent matches this object. This ensures that nodes that have already been reparented don't loose their new parents and should be used over frag.setParent(null).


copyList

protected void copyList(java.util.List source,
                        java.util.List target)

copyList

protected void copyList(java.util.List source,
                        java.util.List target,
                        DBObject newParent)

getTextOrNull

protected java.lang.String getTextOrNull(SQLFragment frag)

appendToBuffer

protected void appendToBuffer(java.lang.StringBuffer query,
                              java.util.List objs,
                              java.lang.String indent)
Adds to the given buffer the list of SQLFragments, comma and newline (with indent) seperated.


setParents

protected void setParents(java.util.List sqlFrags,
                          DBObject parent)
Sets the given parent on each SQLFragment in the given List. Used to ensure the parent on the SELECT or FROM objects.


toString

public java.lang.String toString()
Overrides:
toString in class AbstractDBObject

hashCode

public int hashCode()
Overrides:
hashCode in class AbstractDBObject

getChildren

public SQLFragment[] getChildren()
Deprecated. use getOwnedObjects()

Specified by:
getChildren in interface SQLFragment

Extension SDK 10.1.3.36.73

 

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