Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.0.0)

E17493-01

oracle.javatools.db.sql
Class Function

java.lang.Object
  extended by oracle.javatools.db.AbstractDBObject
      extended by oracle.javatools.db.AbstractChildDBObject
          extended by oracle.javatools.db.sql.AbstractSQLFragment
              extended by oracle.javatools.db.sql.Operation
                  extended by oracle.javatools.db.sql.Function
All Implemented Interfaces:
ChildDBObject, DBObject, SQLFragment, Copyable, DynamicPropertySet
Direct Known Subclasses:
WindowFunction

public class Function
extends Operation

Subclass of Operation for functions. This generic fragment can have any function name, it is not restrictive to only database supported functions. If the function is a grouping function then the appropriate boolean property will be set.

Since:
10.1.3

Nested Class Summary
 
Nested classes/interfaces inherited from class oracle.javatools.db.AbstractDBObject
AbstractDBObject.ChildSupport, AbstractDBObject.ListenerSupport
 
Field Summary
 
Fields inherited from class oracle.javatools.db.sql.AbstractSQLFragment
DEFAULT_SEPARATOR, EMPTY, EMPTY_ARRAY, NEWLINE, SPACE
 
Fields inherited from interface oracle.javatools.db.sql.SQLFragment
CONNECTBY, FROM, GROUPBY, HAVING, MODEL, NOCYCLE, ORDERBY, ORDERSIBLINGSBY, PRIOR, SELECT, STARTWITH, TYPE, WHERE
 
Fields inherited from interface oracle.javatools.db.DBObject
COMMENT
 
Constructor Summary
Function()
          Creates a new, empty, Function.
Function(java.lang.String function, SQLFragment[] arguments)
          Creates a the given function with arguments.
Function(java.lang.String function, SQLFragment[] arguments, boolean grouping)
          Creates a the given function with arguments, and boolean to mark whether the function is a grouping function or not.
Function(java.lang.String function, SQLFragment[] arguments, java.lang.String separator)
          Creates a the given function with arguments and separator.
Function(java.lang.String function, SQLFragment[] arguments, java.lang.String separator, boolean grouping)
          Creates a the given function with arguments, and boolean to mark whether the function is a grouping function or not.
 
Method Summary
 java.lang.String getDistinctSource()
          Returns the source string used to set the DISTINCT/UNIQUE/ALL property of the function.
protected  java.lang.String getDistinctText()
          Override this for aggregate functions which may take a DISTINCT/UNIQUE/ALL qualifier.
 java.lang.String getFunction()
          Gets the function (text).
protected  java.lang.String getOperatorText()
           
 java.lang.String getSeparator()
           
 java.lang.String getTrimLeader()
          Returns whether this is a trim function with LEADING/TRAILING/BOTH text.
 boolean isDistinct()
          Returns whether this function is UNIQUE/DISTINCT.
 boolean isGrouping()
          Returns whether this is a grouping function or not.
 void setDistinct(boolean distinct)
          Sets whether or not this is a DISTICT/UNIQUE function
 void setDistinctSource(java.lang.String distinctSource)
          Set the source string used to define the DISTINCT/UNIQUE/ALL and trim LEADING/TRAILING/BOTH property of the function.
 void setFunction(java.lang.String function)
          Sets the function (text).
 void setGrouping(boolean grouping)
          Sets whether this is a grouping function or not.
 void setSeparator(java.lang.String string)
           
 void setTrimLeader(java.lang.String trimLeader)
          Sets whether this is a trim function with LEADING/TRAILING/BOTH text.
 
Methods inherited from class oracle.javatools.db.sql.Operation
addArgument, addArgument, addArguments, checkArgument, checkNewSize, copyToImpl, equalsImpl, getArgumentCount, getArguments, getSQLText, removeArgument, setArguments, setCommutative, setFunctionFormat
 
Methods inherited from class oracle.javatools.db.sql.AbstractSQLFragment
appendToBuffer, argsToString, getStartOffset, getTextOrNull, getTextOrNull, getType, setParent, setStartOffset, surroundWithBrackets, surroundWithBrackets, toString
 
Methods inherited from class oracle.javatools.db.AbstractChildDBObject
findParent, getParent, getProperty, setProperty
 
Methods inherited from class oracle.javatools.db.AbstractDBObject
changeParent, compareToImpl, copyObject, copyTo, copyTo, copyTo, copyTo, equals, 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.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
 

Constructor Detail

Function

public Function()
Creates a new, empty, Function.


Function

public Function(java.lang.String function,
                SQLFragment[] arguments)
Creates a the given function with arguments.


Function

public Function(java.lang.String function,
                SQLFragment[] arguments,
                java.lang.String separator)
Creates a the given function with arguments and separator.


Function

public Function(java.lang.String function,
                SQLFragment[] arguments,
                boolean grouping)
Creates a the given function with arguments, and boolean to mark whether the function is a grouping function or not.


Function

public Function(java.lang.String function,
                SQLFragment[] arguments,
                java.lang.String separator,
                boolean grouping)
Creates a the given function with arguments, and boolean to mark whether the function is a grouping function or not.

Method Detail

getFunction

public java.lang.String getFunction()
Gets the function (text).


setFunction

public void setFunction(java.lang.String function)
Sets the function (text).


isGrouping

public boolean isGrouping()
Returns whether this is a grouping function or not.


setGrouping

public void setGrouping(boolean grouping)
Sets whether this is a grouping function or not.


isDistinct

public boolean isDistinct()
Returns whether this function is UNIQUE/DISTINCT.

For example count(distinct sal) returns a count of the unique sal's


setDistinct

public void setDistinct(boolean distinct)
Sets whether or not this is a DISTICT/UNIQUE function


getTrimLeader

public java.lang.String getTrimLeader()
Returns whether this is a trim function with LEADING/TRAILING/BOTH text.


setTrimLeader

public void setTrimLeader(java.lang.String trimLeader)
Sets whether this is a trim function with LEADING/TRAILING/BOTH text.


getDistinctSource

public java.lang.String getDistinctSource()
Returns the source string used to set the DISTINCT/UNIQUE/ALL property of the function.


setDistinctSource

public void setDistinctSource(java.lang.String distinctSource)
Set the source string used to define the DISTINCT/UNIQUE/ALL and trim LEADING/TRAILING/BOTH property of the function.


getDistinctText

protected java.lang.String getDistinctText()
Description copied from class: Operation
Override this for aggregate functions which may take a DISTINCT/UNIQUE/ALL qualifier.

Overrides:
getDistinctText in class Operation

getOperatorText

protected java.lang.String getOperatorText()
Specified by:
getOperatorText in class Operation

getSeparator

public java.lang.String getSeparator()
Overrides:
getSeparator in class Operation

setSeparator

public void setSeparator(java.lang.String string)
Overrides:
setSeparator in class Operation

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.0.0)

E17493-01

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