Skip navigation links
oracle.javatools.db.sql
Class AbstractAliasFragment
java.lang.Object
oracle.javatools.db.AbstractDBObject
oracle.javatools.db.AbstractChildDBObject
oracle.javatools.db.sql.AbstractSQLFragment
oracle.javatools.db.sql.AbstractAliasFragment
- All Implemented Interfaces:
- ChildDBObject, DBObject, AliasFragment, SQLFragment, Copyable, DynamicPropertySet
- Direct Known Subclasses:
- FromObject, SelectObject
-
public abstract class AbstractAliasFragment
- extends AbstractSQLFragment
- implements AliasFragment
SQLFragment that consists of an expression and an alias.
- Since:
- 10.1.3
Method Summary |
boolean |
canHaveAlias()
In certain circumstances an AliasFragment cannot have an alias. |
protected boolean |
canUseAsAlias(java.lang.String exp)
Checks whether the given expression can be used as an alias. |
java.lang.String |
getAlias()
Returns the alias portion of this SQLFragment. |
SQLFragment |
getExpression()
Returns the expression portion of this SQLFragment. |
java.lang.String |
getName()
Returns a String that can be used to alias columns that depend on this fragment. |
java.lang.String |
getSQLText()
Returns the entire fragment (expression plus alias in external form). |
java.lang.String |
getUsableAlias()
Deprecated. - use getName() |
void |
setAlias(java.lang.String alias)
Sets the alias part of the fragment. |
void |
setExpression(SQLFragment expression)
Sets the expression part of the fragment. |
void |
setName(java.lang.String name)
Does nothing for this fragment - an alias fragment's name is derived from it's alias or expression. |
java.lang.String |
toString()
|
protected boolean |
useAsBeforeAlias()
Returns true if the current fragment should have an AS between expression and alias. |
Methods inherited from class oracle.javatools.db.AbstractDBObject |
changeParent, compareToImpl, copyObject, copyTo, copyTo, copyTo, copyTo, equals, equalsImpl, findOwnedObject, findOwnedObject, findOwnedObject, getChildSupport, getID, getOwnedObjects, getOwnedObjects, getOwnedObjectsImpl, getProperties, getProperty, getReferenceIDs, getReferenceIDsImpl, hashCode, includeOwnedObject, includesType, includesType, removeThisAsParent, replaceReferenceIDs, setID, setProperties |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface oracle.javatools.db.DBObject |
copyTo, copyTo, copyTo, findOwnedObject, findOwnedObject, getID, getOwnedObjects, getOwnedObjects, getReferenceIDs, getType, replaceReferenceIDs, setID |
AbstractAliasFragment
protected AbstractAliasFragment()
- Creates an empty fragment.
AbstractAliasFragment
protected AbstractAliasFragment(SQLFragment exp,
java.lang.String alias)
- Creates a fragment with given expression and alias. The alias name should be in its external form, i.e. be quoted if necessary
getAlias
public java.lang.String getAlias()
- Returns the alias portion of this SQLFragment.
-
- Specified by:
getAlias
in interface AliasFragment
setAlias
public void setAlias(java.lang.String alias)
- Sets the alias part of the fragment. The alias name should be in its external form, i.e. be quoted if necessary
-
- Specified by:
setAlias
in interface AliasFragment
canHaveAlias
public boolean canHaveAlias()
- In certain circumstances an AliasFragment cannot have an alias. This method returns false if that is the case.
getExpression
public SQLFragment getExpression()
- Returns the expression portion of this SQLFragment.
-
- Specified by:
getExpression
in interface AliasFragment
setExpression
public void setExpression(SQLFragment expression)
- Sets the expression part of the fragment.
-
- Specified by:
setExpression
in interface AliasFragment
getSQLText
public java.lang.String getSQLText()
- Returns the entire fragment (expression plus alias in external form).
-
- Specified by:
getSQLText
in interface AliasFragment
- Specified by:
getSQLText
in interface SQLFragment
-
- Returns:
- a string representing the SQL text for this object.
useAsBeforeAlias
protected boolean useAsBeforeAlias()
- Returns true if the current fragment should have an AS between expression and alias. Returns false by default, subclasses override if appropraite.
getUsableAlias
@Deprecated
public java.lang.String getUsableAlias()
- Deprecated. - use getName()
-
- Specified by:
getUsableAlias
in interface AliasFragment
getName
public java.lang.String getName()
- Returns a String that can be used to alias columns that depend on this fragment.
-
- Specified by:
getName
in interface DBObject
- Specified by:
getName
in interface AliasFragment
- Overrides:
getName
in class AbstractDBObject
-
- Returns:
- the alias if there is one or the expression. NOTE the expression may not be a valid alias depending on the flavour of SQL.
setName
public void setName(java.lang.String name)
- Does nothing for this fragment - an alias fragment's name is derived from it's alias or expression.
-
- Specified by:
setName
in interface DBObject
- Overrides:
setName
in class AbstractDBObject
-
- Parameters:
name
- a string containing the new name for this object.
canUseAsAlias
protected boolean canUseAsAlias(java.lang.String exp)
- Checks whether the given expression can be used as an alias.
toString
public java.lang.String toString()
-
- Overrides:
toString
in class AbstractSQLFragment
Skip navigation links
Copyright © 1997, 2015, Oracle. All rights reserved.