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

E13403-04

oracle.javatools.db.sql
Class CaseStatement

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.CaseStatement
All Implemented Interfaces:
ChildDBObject, DBObject, SQLFragment, Copyable, DynamicPropertySet

public class CaseStatement
extends AbstractSQLFragment

Class to represent a case statement in a sql query.
CASE [expression]
WHEN condition THEN thenExpression
WHEN condition THEN thenExpression ...
[ELSE elseExpression]
END


Nested Class Summary
static class CaseStatement.WhenThen
           
 
Nested classes/interfaces inherited from class oracle.javatools.db.AbstractDBObject
AbstractDBObject.ChildSupport
 
Field Summary
static java.lang.String CASE
           
static java.lang.String ELSE
           
static java.lang.String END
           
static java.lang.String THEN
           
static java.lang.String WHEN
           
 
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, NOCYCLE, ORDERBY, SELECT, STARTWITH, TYPE, WHERE
 
Fields inherited from interface oracle.javatools.db.DBObject
COMMENT
 
Constructor Summary
CaseStatement()
           
CaseStatement(CaseStatement.WhenThen[] whenThens)
          CASE WHEN condition THEN thenExpression ...
CaseStatement(CaseStatement.WhenThen[] whenThens, SQLFragment elseExpression)
          CASE WHEN condition THEN thenExpression ...
CaseStatement(SQLFragment expression, CaseStatement.WhenThen[] whenThens)
          CASE expression WHEN condition THEN thenExpression ...
CaseStatement(SQLFragment expression, CaseStatement.WhenThen[] whenThens, SQLFragment elseExpression)
          CASE expression WHEN condition THEN thenExpression ...
 
Method Summary
 DBObject copyTo(DBObject target, DBObject copyParent, IDPolicy idPolicy)
          Internal copy method used by the API to perform copy operations.
protected  void copyToImpl(CaseStatement copy, DBObject copyParent, IDPolicy idPolicy)
           
 boolean equals(java.lang.Object obj)
           
protected  boolean equalsImpl(CaseStatement other)
           
 SQLFragment getElseExpression()
           
 SQLFragment getExpression()
           
protected  void getOwnedObjectsImpl(java.util.Collection<DBObject> objs, java.lang.String... types)
          Used by all the final children methods.
 java.lang.String getSQLText()
          Return the SQL for this fragment.
 CaseStatement.WhenThen[] getWhenThens()
           
 void setElseExpression(SQLFragment exp)
           
 void setExpression(SQLFragment exp)
           
 void setWhenThens(CaseStatement.WhenThen[] whenThens)
           
 
Methods inherited from class oracle.javatools.db.sql.AbstractSQLFragment
appendToBuffer, argsToString, getTextOrNull, getTextOrNull, getType, setParent, surroundWithBrackets, surroundWithBrackets, toString
 
Methods inherited from class oracle.javatools.db.AbstractChildDBObject
copyToImpl, findParent, getParent
 
Methods inherited from class oracle.javatools.db.AbstractDBObject
changeParent, compareToImpl, copyObject, copyTo, copyTo, copyTo, copyToImpl, equalsImpl, findOwnedObject, findOwnedObject, findOwnedObject, getChildSupport, getID, getName, getOwnedObjects, getOwnedObjects, getProperties, getProperty, getProperty, getReferenceIDs, getReferenceIDsImpl, hashCode, includeOwnedObject, includesType, includesType, removeThisAsParent, replaceReferenceIDs, setID, setName, setProperties, setProperty
 
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

CASE

public static final java.lang.String CASE
See Also:
Constant Field Values

WHEN

public static final java.lang.String WHEN
See Also:
Constant Field Values

THEN

public static final java.lang.String THEN
See Also:
Constant Field Values

ELSE

public static final java.lang.String ELSE
See Also:
Constant Field Values

END

public static final java.lang.String END
See Also:
Constant Field Values
Constructor Detail

CaseStatement

public CaseStatement()

CaseStatement

public CaseStatement(SQLFragment expression,
                     CaseStatement.WhenThen[] whenThens,
                     SQLFragment elseExpression)
CASE expression WHEN condition THEN thenExpression ... ELSE elseExpression END


CaseStatement

public CaseStatement(SQLFragment expression,
                     CaseStatement.WhenThen[] whenThens)
CASE expression WHEN condition THEN thenExpression ... END


CaseStatement

public CaseStatement(CaseStatement.WhenThen[] whenThens,
                     SQLFragment elseExpression)
CASE WHEN condition THEN thenExpression ... ELSE elseExpression END


CaseStatement

public CaseStatement(CaseStatement.WhenThen[] whenThens)
CASE WHEN condition THEN thenExpression ... END

Method Detail

getExpression

public SQLFragment getExpression()

setExpression

public void setExpression(SQLFragment exp)

getWhenThens

public CaseStatement.WhenThen[] getWhenThens()

setWhenThens

public void setWhenThens(CaseStatement.WhenThen[] whenThens)

getElseExpression

public SQLFragment getElseExpression()

setElseExpression

public void setElseExpression(SQLFragment exp)

copyTo

public DBObject copyTo(DBObject target,
                       DBObject copyParent,
                       IDPolicy idPolicy)
Description copied from class: AbstractDBObject
Internal copy method used by the API to perform copy operations. All objects must implement this method if they are instantiable objects. Abstract objects (e.g. Relation) must NOT implement this method. The implementation should delegate to the copyToImpl method to copy the actual properties.

This method does not fix internal reference ids on copy. That is done by the calling DBObject.copyTo(DBObject, IDPolicy) method.

Specified by:
copyTo in class AbstractDBObject
See Also:
DBObject.copyTo(java.lang.Object), DBObject.copyTo(DBObject, boolean), AbstractDBObject.copyToImpl(oracle.javatools.db.AbstractDBObject, oracle.javatools.db.DBObject, oracle.javatools.db.IDPolicy)

copyToImpl

protected void copyToImpl(CaseStatement copy,
                          DBObject copyParent,
                          IDPolicy idPolicy)

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

equalsImpl

protected boolean equalsImpl(CaseStatement other)

getOwnedObjectsImpl

protected void getOwnedObjectsImpl(java.util.Collection<DBObject> objs,
                                   java.lang.String... types)
Description copied from class: AbstractDBObject
Used by all the final children methods. Subclasses should start with super.getOwnedObjectsImpl(type) and then add to the passed list. Use includesType to check the types vararg.

Overrides:
getOwnedObjectsImpl in class AbstractDBObject
Parameters:
objs - a Collection of the apppropriate children.
types - a vararg of the type(s) to search for
See Also:
AbstractDBObject.includesType(java.lang.String, java.lang.String...)

getSQLText

public java.lang.String getSQLText()
Description copied from interface: SQLFragment
Return the SQL for this fragment. This contains no validation - if the implementation is incomplete it will just return what it has. Error checking of fragments should be done using a SQLQueryBuilder.

Returns:
a string representing the SQL text for this object.

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

E13403-04

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