Extension SDK 9.0.5

oracle.jdeveloper.cm.ds.db
Class Column

java.lang.Object
  extended byoracle.jdeveloper.cm.ds.db.AbstractDBObject
      extended byoracle.jdeveloper.cm.ds.db.Column
All Implemented Interfaces:
Copyable, DBObject, Subject

public class Column
extends AbstractDBObject

Model of a database column.


Field Summary
static java.lang.String TYPE
           
 
Fields inherited from interface oracle.jdeveloper.cm.ds.db.DBObject
COMMENT
 
Fields inherited from interface oracle.ide.addin.Subject
OBJECT_MODIFIED
 
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)
          Constructs a new Column with the specified name and datatype.
 
Method Summary
 java.lang.Object copyTo(java.lang.Object target)
          Copies the state of this DBObject to another instance.
protected  void copyToImpl(Column copy)
           
 boolean equals(java.lang.Object target)
           
 boolean equalsImpl(Column copy)
           
 DataType getDataType()
          Gets the datatype of the Column.
 java.lang.Object getDefault()
          Retrieves the default value for the Column.
 java.lang.Long getPrecision()
          Retrieves the precision or size of the Column.
 Relation getRelation()
          Gets the Relation that owns this Column.
 java.lang.Long getScale()
          Gets the scale of the Column.
 java.lang.String getType()
          Returns the type of this object.
 boolean isNotNull()
          Whether the Column is restricted to non-null values.
 void setDataType(DataType dataType)
          Sets the datatype of the 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 newPrecision)
          Sets the precision of size of the Column.
 void setRelation(Relation relation)
          Sets the Relation that owns this Column.
 void setScale(java.lang.Long newScale)
          Sets the scale of the Column.
 
Methods inherited from class oracle.jdeveloper.cm.ds.db.AbstractDBObject
attach, compareToImpl, copyToImpl, detach, equalsImpl, getID, getName, getProperties, getProperty, hashCode, notifyObservers, setID, setName, setProperties, setProperty, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE

public static final java.lang.String TYPE
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,
              DataType dataType)
Constructs a new Column with the specified name and datatype.

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

copyTo

public java.lang.Object copyTo(java.lang.Object target)
Description copied from interface: DBObject
Copies the state of this DBObject to another instance. If null is specified for the target, a new instance will be created.

The entire state of the object will be copied, with a few exceptions. In particular, any observers registered will NOT be copied. In cases where this instance contains child DBObjects, new instances of those children will be created, and the state copied to them. The copy will thus contain its own unique state; after making the copy, changing one instance will not cause any changes to occur to the copy. The properties will be copied; however, copies will not be made of the values referenced by the properties - thus, the copy will refer to the same instance as the original. Child objects that are copied will still point to the original parent; it is the responsibility of a copied parent to update the parent of copies of its children point to the copy of itself.

The ID associated with this object will not be copied. If the copy is intended to be a temporary copy of this object (to be used in a dialog editing the object for example), then the caller should explicitly set the ID of the copy to be the same as on this object. However, if the new object is intended to exist separately from this object, the caller should ensure that the new object have a different ID from this object.

Parameters:
target - The object to copy to. If target is null, a new instance will be created, and the state will be copied to that object.
Returns:
the copy.

copyToImpl

protected void copyToImpl(Column copy)

equals

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

equalsImpl

public 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

getPrecision

public java.lang.Long getPrecision()
Retrieves the precision or size of the Column.

Returns:
the long value representing the precision of this column, or null if this column does not have precision

setPrecision

public void setPrecision(java.lang.Long newPrecision)
Sets the precision of size of the Column.

Parameters:
newPrecision - the long value representing the precision of this column, or null if this column does not have precision

getScale

public java.lang.Long getScale()
Gets the scale of the Column. Scale is only relevant for numeric datatypes.

Returns:
the long value representing the scale of this column, or null if this column does not have scale

setScale

public void setScale(java.lang.Long newScale)
Sets the scale of the Column. Scale is only relevant for numeric datatypes.

Parameters:
newScale - the long value representing the scale of this column, or null if this column does not have scale

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.

setDataType

public void setDataType(DataType dataType)
Sets the datatype of the Column.

Parameters:
dataType - the datatype of this. Column

getDataType

public DataType getDataType()
Gets the datatype of the Column.

Returns:
the datatype of this column.

getRelation

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

Returns:
the Relation that owns this column
Throws:
TransientMarker

setRelation

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

Parameters:
relation - the Relation that owns this column.

Extension SDK

 

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