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

E13403-03

oracle.javatools.db
Class Column

java.lang.Object
  extended by oracle.javatools.db.AbstractDBObject
      extended by oracle.javatools.db.AbstractChildDBObject
          extended by oracle.javatools.db.Column
All Implemented Interfaces:
ChildDBObject, DBObject, Copyable, DynamicPropertySet
Direct Known Subclasses:
ViewColumn

public class Column
extends AbstractChildDBObject

Model of a database column.


Nested Class Summary
 
Nested classes/interfaces inherited from class oracle.javatools.db.AbstractDBObject
AbstractDBObject.ChildSupport
 
Field Summary
static java.lang.String AUTO_GENERATED_SEQUENCE
           
static java.lang.String AUTO_GENERATED_SEQUENCE_TRIGGER
           
static java.lang.String TYPE
           
 
Fields inherited from interface oracle.javatools.db.DBObject
COMMENT
 
Constructor Summary
Column()
          Constructs a new Column.
Column(java.lang.String name)
          Constructs a new Column with the specified name.
Column(java.lang.String name, DataType dataType)
          Deprecated. use Column( String name, DataTypeUsage usage )
Column(java.lang.String name, DataTypeUsage usage)
          Constructs a new Column with the specified name and datatype.
Column(java.lang.String name, DBObjectID dataTypeID)
          Deprecated. use Column( String name, DataTypeUsage usage )
 
Method Summary
 DBObject copyTo(DBObject target, DBObject copyParent, IDPolicy idPolicy)
          Internal copy method used by the API to perform copy operations.
protected  void copyToImpl(Column copy, DBObject copyParent, IDPolicy idPolicy)
           
 boolean equals(java.lang.Object target)
           
protected  boolean equalsImpl(Column copy)
           
 DataTypeUsage getDataTypeUsage()
          Gets the usage object for the datatype information for this column.
 java.lang.Object getDefault()
          Retrieves the default value for the Column.
protected  void getOwnedObjectsImpl(java.util.Collection<DBObject> objs, java.lang.String... types)
          Used by all the final children methods.
 java.lang.Long getPrecision()
          Deprecated. - use getDataTypeUsage() and then get the appropriate attribute from the DataTypeUsage.
e.g. dataTypeUsage.getAttributeValue( DataTypeAttribute.DATATYPE_PRECISION)
protected  void getReferenceIDsImpl(java.util.Collection<DBObjectID> refs)
          Used by the final getReferenceID() implementation.
 Relation getRelation()
          Gets the Relation that owns this Column.
 java.lang.Long getScale()
          Deprecated. - use getDataTypeUsage() and then get the appropriate attribute from the DataTypeUsage.
e.g. dataTypeUsage.getAttributeValue( DataTypeAttribute.DATATYPE_SCALE)
 java.lang.String getType()
          Returns the type of this object.
 boolean isNotNull()
          Whether the Column is restricted to non-null values.
 boolean replaceReferenceIDs(java.util.Map<DBObjectID,DBObjectID> idMap)
          Override in subclasses to replace reference IDs as appropriate.
 void setDataTypeUsage(DataTypeUsage dataTypeUsage)
          Sets the usage object for the datatype information for this column.
 void setDefault(java.lang.Object defaultValue)
          Sets the default value for the Column.
 void setNotNull(boolean newNotNull)
          Sets whether the Column is restricted to non-null values.
 void setPrecision(java.lang.Long precision)
          Deprecated. - use getDataTypeUsage() and then set the appropriate attribute from the DataTypeUsage.
e.g. dataTypeUsage.setAttributeValue( DataTypeAttribute.DATATYPE_PRECISION)
 void setRelation(Relation relation)
          Sets the Relation that owns this Column.
 void setScale(java.lang.Long scale)
          Deprecated. - use getDataTypeUsage() and then set the appropriate attribute from the DataTypeUsage.
e.g. dataTypeUsage.setAttributeValue( DataTypeAttribute.DATATYPE_SCALE)
 
Methods inherited from class oracle.javatools.db.AbstractChildDBObject
copyToImpl, findParent, getParent, setParent
 
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, hashCode, includeOwnedObject, includesType, includesType, removeThisAsParent, setID, setName, setProperties, setProperty, toString
 
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, getName, getOwnedObjects, getOwnedObjects, getReferenceIDs, setID, setName
 
Methods inherited from interface oracle.javatools.util.DynamicPropertySet
getProperties, getProperty, getProperty, setProperties, setProperty
 

Field Detail

TYPE

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

AUTO_GENERATED_SEQUENCE

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

AUTO_GENERATED_SEQUENCE_TRIGGER

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

Column

public Column()
Constructs a new Column.


Column

public Column(java.lang.String name)
Constructs a new Column with the specified name.

Parameters:
name - a string containing the column name

Column

public Column(java.lang.String name,
              DataTypeUsage usage)
Constructs a new Column with the specified name and datatype.

Parameters:
name - a string containing the column name
dataType - the datatype of the column

Column

@Deprecated
public Column(java.lang.String name,
                         DataType dataType)
Deprecated. use Column( String name, DataTypeUsage usage )

Constructs a new Column with the specified name and datatype.

Parameters:
name - a string containing the column name
dataType - the datatype of the column

Column

@Deprecated
public Column(java.lang.String name,
                         DBObjectID dataTypeID)
Deprecated. use Column( String name, DataTypeUsage usage )

Constructs a new Column with the specified name and datatype.

Parameters:
name - a string containing the column name
dataTypeID - the id for the datatype of the column
Method Detail

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(Column copy,
                          DBObject copyParent,
                          IDPolicy idPolicy)

equals

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

equalsImpl

protected boolean equalsImpl(Column copy)

setDefault

public void setDefault(java.lang.Object defaultValue)
Sets the default value for the Column. The default value of a column is used whenever an insert or update does not specify a value for the column.

Parameters:
defaultValue - an object representing the default value for the Column. null means the column has no default. To specify that the Column should default to NULL, use the String value "NULL".

getDefault

public java.lang.Object getDefault()
Retrieves the default value for the Column. The default value of a column is used whenever an insert or update does not specify a value for the column.

Returns:
the default value for the Column, or null if no default is specified

isNotNull

public boolean isNotNull()
Whether the Column is restricted to non-null values.

Returns:
a boolean value indicating whether null values are disallowed

setNotNull

public void setNotNull(boolean newNotNull)
Sets whether the Column is restricted to non-null values.

Parameters:
newNotNull - boolean value indicating whether null values are disallowed

setDataTypeUsage

public void setDataTypeUsage(DataTypeUsage dataTypeUsage)
Sets the usage object for the datatype information for this column. This includes the datatype used, as well as any parameters for the usage of that type (e.g. precision, scale, etc).


getDataTypeUsage

public DataTypeUsage getDataTypeUsage()
Gets the usage object for the datatype information for this column. This includes the datatype used, as well as any parameters for the usage of that type (e.g. precision, scale, etc).


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.

Returns:
a string describing the type of object.

getRelation

public Relation getRelation()
Gets the Relation that owns this Column.

Returns:
the Relation that owns this column

setRelation

public void setRelation(Relation relation)
Sets the Relation that owns this Column.

Parameters:
relation - the Relation that owns this column.

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

getReferenceIDsImpl

protected void getReferenceIDsImpl(java.util.Collection<DBObjectID> refs)
Description copied from class: AbstractDBObject
Used by the final getReferenceID() implementation. The list should not contain null values, or be null. Subclasses should start with super.getReferenceIDsImpl() and then add to the passed list as appopriate.

Overrides:
getReferenceIDsImpl in class AbstractDBObject
Parameters:
refs - the collection of ids this object references

replaceReferenceIDs

public boolean replaceReferenceIDs(java.util.Map<DBObjectID,DBObjectID> idMap)
Description copied from class: AbstractDBObject
Override in subclasses to replace reference IDs as appropriate. Always call super in the overridden implementation to make sure the default implementation (which checks the property map) is called.

Specified by:
replaceReferenceIDs in interface DBObject
Overrides:
replaceReferenceIDs in class AbstractDBObject
Parameters:
idMap - key = old DBObjectID, value = new DBObjectID
Returns:
true if any ids were replaced.

getPrecision

@Deprecated
public java.lang.Long getPrecision()
Deprecated. - use getDataTypeUsage() and then get the appropriate attribute from the DataTypeUsage.
e.g. dataTypeUsage.getAttributeValue( DataTypeAttribute.DATATYPE_PRECISION)


setPrecision

@Deprecated
public void setPrecision(java.lang.Long precision)
Deprecated. - use getDataTypeUsage() and then set the appropriate attribute from the DataTypeUsage.
e.g. dataTypeUsage.setAttributeValue( DataTypeAttribute.DATATYPE_PRECISION)


getScale

@Deprecated
public java.lang.Long getScale()
Deprecated. - use getDataTypeUsage() and then get the appropriate attribute from the DataTypeUsage.
e.g. dataTypeUsage.getAttributeValue( DataTypeAttribute.DATATYPE_SCALE)


setScale

@Deprecated
public void setScale(java.lang.Long scale)
Deprecated. - use getDataTypeUsage() and then set the appropriate attribute from the DataTypeUsage.
e.g. dataTypeUsage.setAttributeValue( DataTypeAttribute.DATATYPE_SCALE)


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

E13403-03

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