com.im.commons.db 5.9.2

com.im.commons.db.ddl
Class DBColInfo

java.lang.Object
  extended by com.im.commons.db.ddl.DBColInfo
All Implemented Interfaces:
AbstractInfo, Serializable

public class DBColInfo
extends Object
implements AbstractInfo, Serializable

Database info class for a database column. This object is returned from DBTableInfo. TODO - reconsider the name of this class. Logically it should be DBColumnInfoImpl but this causes a clash with the DBFieldCapability.DBColumn inner class used in DIF.

See Also:
Serialized Form

Nested Class Summary
static class DBColInfo.ImplementationType
           
 
Field Summary
static String PROP_CHEMICAL_TERMS_FORMULA
           
static String PROP_COLUMN_DEFINITION
           
static String PROP_COLUMN_NAME
           
static String PROP_DEFAULT_VALUE
           
static String PROP_FIELD
           
static String PROP_JDBC_TYPE
           
static String PROP_LENGTH
           
static String PROP_REQUIRED
           
static String PROP_SCALE
           
 
Constructor Summary
DBColInfo()
           
DBColInfo(String colName, DBDatabaseInfo.NativeType type, boolean required, String def, DBColInfo.ImplementationType implementationType)
           
 
Method Summary
 void addToModel(String parentID, DBItemsCache cache)
           
 boolean equals(Object obj)
           
protected  void firePropertyChange(String propertyName, Object oldValue, Object newValue)
          Notifies all registered listeners about the event.
 String getColumnDefinition()
          Get the current column definition for the particular database type.
 String getColumnDefinitionMesageFormat()
           
 String getColumnName()
          Getter for property columnName.
 DBDatabaseInfo.ColumnSQLType getColumnType()
          Returns column type for this DB column.
 String getDefaultValue()
          Getter for property defaultValue.
 DBColInfo.ImplementationType getImplementationType()
           
 int getJdbcType()
          Getter for property jdbcType.
 int getLength()
          Getter for property length.
 DBDatabaseInfo.NativeType getNativeType()
           
 String getProperty(String key)
           
 DBDatabaseInfo.ResizingSupported getResizingSupported()
           
 int getScale()
          Getter for property scale.
 int hashCode()
           
 boolean isPropertyReadOnly(String propName)
           
 boolean isRequired()
          NULL or NOT NULL.
 void removeFromModel(String parentID, DBItemsCache cache)
           
 DBColInfo removeProperty(String key)
          Remove a property.
 void removePropertyChangeListener(PropertyChangeListener listener)
          Removes PropertyChangeListener from the list of listeners.
 void setPropertyReadOnly(String propName, boolean b)
           
 String toString()
           
 DBColInfo updateProperties(Map<String,String> nue)
           
 DBColInfo updateProperty(String key, String value)
          Update or add a property.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

PROP_COLUMN_NAME

public static final String PROP_COLUMN_NAME
See Also:
Constant Field Values

PROP_JDBC_TYPE

public static final String PROP_JDBC_TYPE
See Also:
Constant Field Values

PROP_SCALE

public static final String PROP_SCALE
See Also:
Constant Field Values

PROP_LENGTH

public static final String PROP_LENGTH
See Also:
Constant Field Values

PROP_REQUIRED

public static final String PROP_REQUIRED
See Also:
Constant Field Values

PROP_DEFAULT_VALUE

public static final String PROP_DEFAULT_VALUE
See Also:
Constant Field Values

PROP_COLUMN_DEFINITION

public static final String PROP_COLUMN_DEFINITION
See Also:
Constant Field Values

PROP_FIELD

public static final String PROP_FIELD
See Also:
Constant Field Values

PROP_CHEMICAL_TERMS_FORMULA

public static final String PROP_CHEMICAL_TERMS_FORMULA
See Also:
Constant Field Values
Constructor Detail

DBColInfo

public DBColInfo()

DBColInfo

public DBColInfo(String colName,
                 DBDatabaseInfo.NativeType type,
                 boolean required,
                 String def,
                 DBColInfo.ImplementationType implementationType)
Method Detail

getProperty

public String getProperty(String key)

updateProperties

public DBColInfo updateProperties(Map<String,String> nue)

updateProperty

public DBColInfo updateProperty(String key,
                                String value)
Update or add a property.

Parameters:
key -
value -
Returns:
The new DBColInfo instance with the new property

removeProperty

public DBColInfo removeProperty(String key)
Remove a property.

Parameters:
key -
Returns:
The new DBColInfo instance with the new property

getColumnName

public String getColumnName()
Getter for property columnName.

Returns:
Value of property columnName.

getJdbcType

public int getJdbcType()
Getter for property jdbcType.

Returns:
Value of property jdbcType.

getNativeType

public DBDatabaseInfo.NativeType getNativeType()
Returns:
The native type of this column

getLength

public int getLength()
Getter for property length.

Returns:
Value of property length.

getColumnType

public DBDatabaseInfo.ColumnSQLType getColumnType()
Returns column type for this DB column.


getScale

public int getScale()
Getter for property scale.

Returns:
Value of property scale.

getColumnDefinition

public String getColumnDefinition()
Get the current column definition for the particular database type. e.g. VARCHAR2(255) or NUMBER(10.1)

Returns:
The column definition, or null if the column has not yet been initialized for the database type

isRequired

public boolean isRequired()
NULL or NOT NULL.

Returns:
Value of property required.

getDefaultValue

public String getDefaultValue()
Getter for property defaultValue.

Returns:
Value of property defaultValue.

getImplementationType

public DBColInfo.ImplementationType getImplementationType()

getResizingSupported

public DBDatabaseInfo.ResizingSupported getResizingSupported()

getColumnDefinitionMesageFormat

public String getColumnDefinitionMesageFormat()

isPropertyReadOnly

public boolean isPropertyReadOnly(String propName)

setPropertyReadOnly

public final void setPropertyReadOnly(String propName,
                                      boolean b)

addToModel

public void addToModel(String parentID,
                       DBItemsCache cache)
Specified by:
addToModel in interface AbstractInfo

removeFromModel

public void removeFromModel(String parentID,
                            DBItemsCache cache)
Specified by:
removeFromModel in interface AbstractInfo

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Removes PropertyChangeListener from the list of listeners.

Parameters:
listener - The listener to remove.

firePropertyChange

protected void firePropertyChange(String propertyName,
                                  Object oldValue,
                                  Object newValue)
Notifies all registered listeners about the event.


equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

com.im.commons.db 5.9.2