Skip navigation links

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

E17493-04


oracle.javatools.db.sql
Class Comparison

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.Comparison

All Implemented Interfaces:
ChildDBObject, DBObject, SQLFragment, Copyable, DynamicPropertySet

public class Comparison
extends Operation

Subclass of Operation for comparisons. Operation only has two arguments - a left and right expression.
By default a Comparison object is EQUAL

Since:
10.1.3

Nested Class Summary

 

Nested classes/interfaces inherited from class oracle.javatools.db.AbstractDBObject
AbstractDBObject.ChildSupport, AbstractDBObject.ListenerSupport

 

Field Summary
static int EQUAL
          Equal
static int EQUAL_ALL
           
static int EQUAL_ANY
           
static int EQUAL_SOME
           
static int EXISTS
          Exists
static int GREATER
          Greater Than
static int GREATER_EQUAL
          Greater Than Or Equal To
static int GREATER_THAN_ALL
           
static int GREATER_THAN_ANY
           
static int GREATER_THAN_OR_EQUAL_ALL
           
static int GREATER_THAN_OR_EQUAL_ANY
           
static int GREATER_THAN_OR_EQUAL_SOME
           
static int GREATER_THAN_SOME
           
static int INTERSECT
           
static int LESS
          Less Than
static int LESS_EQUAL
          Less Than Or Equal To
static int LESS_THAN_ALL
           
static int LESS_THAN_ANY
           
static int LESS_THAN_OR_EQUAL_ALL
           
static int LESS_THAN_OR_EQUAL_ANY
           
static int LESS_THAN_OR_EQUAL_SOME
           
static int LESS_THAN_SOME
           
static int LIKE
          Like
static int MINUS
           
static int NOT_EQUAL
          Not Equal
static int NOT_EQUAL_ALL
           
static int NOT_EQUAL_ANY
           
static int NOT_EQUAL_SOME
           
static int NOT_EXISTS
          Not Exists
static int NOT_IN
           
static int NOT_LIKE
          Not Like
static int NOT_NULL
          Is Not Null
static int NULL
          Is Null
static int UNION
           
static int UNION_ALL
           

 

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
Comparison()
          Constructs a new, empty, comparison object.
Comparison(SQLFragment left, int comparator)
          Left argument only constructor - used for IS NULL, IS NOT NULL, EXISTS and NOT EXISTS.
Comparison(SQLFragment left, int comparator, SQLFragment right)
          Constructs a new comparison fragment with the given expressions and comparator.

 

Method Summary
 void addArgument(int index, SQLFragment expression)
           
 void addArgument(SQLFragment expression)
           
 void addArguments(SQLFragment[] expressions)
           
protected  void checkNewSize(int proposedSize)
          Override for operations that have specific size restrictions.
 int getArgumentCount()
          Returns the number of arguments stored.
 SQLFragment[] getArguments()
          Returns the arguments stored in this function.
 int getComparator()
          Returns the comparator for this comparison fragment.
static java.lang.String getComparatorText(int op)
          Returns the comparator text for the given int.
static int getComparisonOperation(java.lang.String operator)
          Returns the comparisson code for the given text.
 SQLFragment getLeftExpression()
          Gets the left expression.
 java.lang.String getOperatorText()
          Returns the text for the comparator for this comparison fragment.
 boolean getPriorOnLeft()
          Has the left expression got a PRIOR operator
 boolean getPriorOnRight()
          Has the right expression got a PRIOR operator
 SQLFragment getRightExpression()
          Gets the right expression.
 java.lang.String getSQLText()
          Returns the complete SQL representation for this Function fragment.
static boolean isComparator(int op)
           
 boolean removeArgument(SQLFragment expression)
           
 void setArguments(SQLFragment[] arguments)
          Sets the arguments for this function.
 void setComparator(int comparator)
          Sets the comparator for this comparison object.
 void setLeftExpression(SQLFragment leftExpression)
          Sets the left expression.
 void setPriorOnLeft(boolean priorOnLeft)
          Set whether the left expression has a PRIOR operator
 void setPriorOnRight(boolean priorOnRight)
          Set whether the right expression has a PRIOR operator
 void setRightExpression(SQLFragment rightExpression)
          Sets the right expression.

 

Methods inherited from class oracle.javatools.db.sql.Operation
checkArgument, copyToImpl, equalsImpl, getDistinctText, getSeparator, setCommutative, setFunctionFormat, setSeparator

 

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

 

Field Detail

GREATER

public static final int GREATER
Greater Than
See Also:
Constant Field Values

LESS

public static final int LESS
Less Than
See Also:
Constant Field Values

GREATER_EQUAL

public static final int GREATER_EQUAL
Greater Than Or Equal To
See Also:
Constant Field Values

LESS_EQUAL

public static final int LESS_EQUAL
Less Than Or Equal To
See Also:
Constant Field Values

EQUAL

public static final int EQUAL
Equal
See Also:
Constant Field Values

NOT_EQUAL

public static final int NOT_EQUAL
Not Equal
See Also:
Constant Field Values

NULL

public static final int NULL
Is Null
See Also:
Constant Field Values

NOT_NULL

public static final int NOT_NULL
Is Not Null
See Also:
Constant Field Values

LIKE

public static final int LIKE
Like
See Also:
Constant Field Values

NOT_LIKE

public static final int NOT_LIKE
Not Like
See Also:
Constant Field Values

EXISTS

public static final int EXISTS
Exists
See Also:
Constant Field Values

NOT_EXISTS

public static final int NOT_EXISTS
Not Exists
See Also:
Constant Field Values

EQUAL_ANY

public static final int EQUAL_ANY
See Also:
Constant Field Values

NOT_EQUAL_ANY

public static final int NOT_EQUAL_ANY
See Also:
Constant Field Values

GREATER_THAN_ANY

public static final int GREATER_THAN_ANY
See Also:
Constant Field Values

GREATER_THAN_OR_EQUAL_ANY

public static final int GREATER_THAN_OR_EQUAL_ANY
See Also:
Constant Field Values

LESS_THAN_ANY

public static final int LESS_THAN_ANY
See Also:
Constant Field Values

LESS_THAN_OR_EQUAL_ANY

public static final int LESS_THAN_OR_EQUAL_ANY
See Also:
Constant Field Values

EQUAL_SOME

public static final int EQUAL_SOME
See Also:
Constant Field Values

NOT_EQUAL_SOME

public static final int NOT_EQUAL_SOME
See Also:
Constant Field Values

GREATER_THAN_SOME

public static final int GREATER_THAN_SOME
See Also:
Constant Field Values

GREATER_THAN_OR_EQUAL_SOME

public static final int GREATER_THAN_OR_EQUAL_SOME
See Also:
Constant Field Values

LESS_THAN_SOME

public static final int LESS_THAN_SOME
See Also:
Constant Field Values

LESS_THAN_OR_EQUAL_SOME

public static final int LESS_THAN_OR_EQUAL_SOME
See Also:
Constant Field Values

EQUAL_ALL

public static final int EQUAL_ALL
See Also:
Constant Field Values

NOT_EQUAL_ALL

public static final int NOT_EQUAL_ALL
See Also:
Constant Field Values

GREATER_THAN_ALL

public static final int GREATER_THAN_ALL
See Also:
Constant Field Values

GREATER_THAN_OR_EQUAL_ALL

public static final int GREATER_THAN_OR_EQUAL_ALL
See Also:
Constant Field Values

LESS_THAN_ALL

public static final int LESS_THAN_ALL
See Also:
Constant Field Values

LESS_THAN_OR_EQUAL_ALL

public static final int LESS_THAN_OR_EQUAL_ALL
See Also:
Constant Field Values

NOT_IN

public static final int NOT_IN
See Also:
Constant Field Values

INTERSECT

public static final int INTERSECT
See Also:
Constant Field Values

UNION

public static final int UNION
See Also:
Constant Field Values

MINUS

public static final int MINUS
See Also:
Constant Field Values

UNION_ALL

public static final int UNION_ALL
See Also:
Constant Field Values

Constructor Detail

Comparison

public Comparison()
Constructs a new, empty, comparison object.

Comparison

public Comparison(SQLFragment left,
                  int comparator)
Left argument only constructor - used for IS NULL, IS NOT NULL, EXISTS and NOT EXISTS.

Comparison

public Comparison(SQLFragment left,
                  int comparator,
                  SQLFragment right)
Constructs a new comparison fragment with the given expressions and comparator.

Method Detail

getComparator

public int getComparator()
Returns the comparator for this comparison fragment. Use getComparatorText() to return By default a Comparison object is EQUAL

getOperatorText

public java.lang.String getOperatorText()
Returns the text for the comparator for this comparison fragment. By default a Comparison object is EQUAL
Specified by:
getOperatorText in class Operation

setComparator

public void setComparator(int comparator)
Sets the comparator for this comparison object. One of the static members must be used or an IllegalArgumentException will be thrown.

getLeftExpression

public SQLFragment getLeftExpression()
Gets the left expression.

setLeftExpression

public void setLeftExpression(SQLFragment leftExpression)
Sets the left expression.

getRightExpression

public SQLFragment getRightExpression()
Gets the right expression.

setRightExpression

public void setRightExpression(SQLFragment rightExpression)
Sets the right expression.

setPriorOnLeft

public void setPriorOnLeft(boolean priorOnLeft)
Set whether the left expression has a PRIOR operator

getPriorOnLeft

public boolean getPriorOnLeft()
Has the left expression got a PRIOR operator

setPriorOnRight

public void setPriorOnRight(boolean priorOnRight)
Set whether the right expression has a PRIOR operator

getPriorOnRight

public boolean getPriorOnRight()
Has the right expression got a PRIOR operator

checkNewSize

protected void checkNewSize(int proposedSize)
Description copied from class: Operation
Override for operations that have specific size restrictions. Subclasses should throw an IllegalArgumentException if the proposed new size is illegal.
Overrides:
checkNewSize in class Operation

getSQLText

public java.lang.String getSQLText()
Description copied from class: Operation
Returns the complete SQL representation for this Function fragment.
Specified by:
getSQLText in interface SQLFragment
Overrides:
getSQLText in class Operation
Returns:
a string representing the SQL text for this object.

addArgument

public void addArgument(int index,
                        SQLFragment expression)
Overrides:
addArgument in class Operation

addArgument

public void addArgument(SQLFragment expression)
Overrides:
addArgument in class Operation

addArguments

public void addArguments(SQLFragment[] expressions)
Overrides:
addArguments in class Operation

getArgumentCount

public int getArgumentCount()
Description copied from class: Operation
Returns the number of arguments stored.
Overrides:
getArgumentCount in class Operation

setArguments

public void setArguments(SQLFragment[] arguments)
Description copied from class: Operation
Sets the arguments for this function.
Overrides:
setArguments in class Operation

removeArgument

public boolean removeArgument(SQLFragment expression)
Overrides:
removeArgument in class Operation

getArguments

public SQLFragment[] getArguments()
Description copied from class: Operation
Returns the arguments stored in this function.
Overrides:
getArguments in class Operation

isComparator

public static boolean isComparator(int op)

getComparatorText

public static java.lang.String getComparatorText(int op)
Returns the comparator text for the given int. Returns null if one of the static members isn't used.

getComparisonOperation

public static int getComparisonOperation(java.lang.String operator)
Returns the comparisson code for the given text. Returns -1 if the text does not match a known comparisson

Skip navigation links

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

E17493-04


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