Package com.im.commons.db.ddl
Class DBColInfo
- java.lang.Object
-
- com.im.commons.db.ddl.DBColInfo
-
- All Implemented Interfaces:
AbstractInfo
,java.io.Serializable
public class DBColInfo extends java.lang.Object implements AbstractInfo, java.io.Serializable
Database info class for a database column. This object is returned fromDBTableInfo
.- Author:
- Tim Dudgeon
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DBColInfo.ImplementationType
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PROP_CHEMICAL_TERMS_FORMULA
static java.lang.String
PROP_COLUMN_DEFINITION
static java.lang.String
PROP_COLUMN_NAME
static java.lang.String
PROP_DEFAULT_VALUE
static java.lang.String
PROP_FIELD
static java.lang.String
PROP_JDBC_TYPE
static java.lang.String
PROP_LENGTH
static java.lang.String
PROP_REQUIRED
static java.lang.String
PROP_SCALE
-
Constructor Summary
Constructors Constructor Description DBColInfo()
DBColInfo(java.lang.String colName, DBDatabaseInfo.NativeType type, boolean required, java.lang.String def, DBColInfo.ImplementationType implementationType)
DBColInfo(java.lang.String colName, DBDatabaseInfo.NativeType type, boolean required, java.lang.String def, DBColInfo.ImplementationType implementationType, boolean oracleTextIndexPresent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addToModel(java.lang.String parentID, DBItemsCache cache)
boolean
equals(java.lang.Object obj)
protected void
firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
Notifies all registered listeners about the event.java.lang.String
getColumnDefinition()
Get the current column definition for the particular database type.java.lang.String
getColumnDefinitionMesageFormat()
java.lang.String
getColumnName()
Getter for property columnName.DBDatabaseInfo.ColumnSQLType
getColumnType()
java.lang.String
getDefaultValue()
Getter for property defaultValue.DBColInfo.ImplementationType
getImplementationType()
int
getJdbcType()
Getter for property jdbcType.int
getLength()
Getter for property length.DBDatabaseInfo.NativeType
getNativeType()
java.lang.String
getProperty(java.lang.String key)
DBDatabaseInfo.ResizingSupported
getResizingSupported()
int
getScale()
Getter for property scale.int
hashCode()
boolean
isOracleTextIndexPresent()
boolean
isPropertyReadOnly(java.lang.String propName)
boolean
isRequired()
NULL or NOT NULL.void
removeFromModel(java.lang.String parentID, DBItemsCache cache)
DBColInfo
removeProperty(java.lang.String key)
Remove a property.void
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes PropertyChangeListener from the list of listeners.void
setPropertyReadOnly(java.lang.String propName, boolean b)
java.lang.String
toString()
DBColInfo
updateProperties(java.util.Map<java.lang.String,java.lang.String> nue)
DBColInfo
updateProperty(java.lang.String key, java.lang.String value)
Update or add a property.
-
-
-
Field Detail
-
PROP_COLUMN_NAME
public static final java.lang.String PROP_COLUMN_NAME
- See Also:
- Constant Field Values
-
PROP_JDBC_TYPE
public static final java.lang.String PROP_JDBC_TYPE
- See Also:
- Constant Field Values
-
PROP_SCALE
public static final java.lang.String PROP_SCALE
- See Also:
- Constant Field Values
-
PROP_LENGTH
public static final java.lang.String PROP_LENGTH
- See Also:
- Constant Field Values
-
PROP_REQUIRED
public static final java.lang.String PROP_REQUIRED
- See Also:
- Constant Field Values
-
PROP_DEFAULT_VALUE
public static final java.lang.String PROP_DEFAULT_VALUE
- See Also:
- Constant Field Values
-
PROP_COLUMN_DEFINITION
public static final java.lang.String PROP_COLUMN_DEFINITION
- See Also:
- Constant Field Values
-
PROP_FIELD
public static final java.lang.String PROP_FIELD
- See Also:
- Constant Field Values
-
PROP_CHEMICAL_TERMS_FORMULA
public static final java.lang.String PROP_CHEMICAL_TERMS_FORMULA
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DBColInfo
public DBColInfo()
-
DBColInfo
public DBColInfo(java.lang.String colName, DBDatabaseInfo.NativeType type, boolean required, java.lang.String def, DBColInfo.ImplementationType implementationType)
-
DBColInfo
public DBColInfo(java.lang.String colName, DBDatabaseInfo.NativeType type, boolean required, java.lang.String def, DBColInfo.ImplementationType implementationType, boolean oracleTextIndexPresent)
-
-
Method Detail
-
getProperty
public java.lang.String getProperty(java.lang.String key)
-
updateProperties
public DBColInfo updateProperties(java.util.Map<java.lang.String,java.lang.String> nue)
-
updateProperty
public DBColInfo updateProperty(java.lang.String key, java.lang.String value)
Update or add a property.- Parameters:
key
- key of propertyvalue
- value of property- Returns:
- The new DBColInfo instance with the new property
-
removeProperty
public DBColInfo removeProperty(java.lang.String key)
Remove a property.- Parameters:
key
- key of removed property- Returns:
- The new DBColInfo instance with the new property
-
getColumnName
public java.lang.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 java.lang.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 java.lang.String getDefaultValue()
Getter for property defaultValue.- Returns:
- Value of property defaultValue.
-
getImplementationType
public DBColInfo.ImplementationType getImplementationType()
-
isOracleTextIndexPresent
public boolean isOracleTextIndexPresent()
- Returns:
- true if Oracle Text CONTEXT type index is present.
-
getResizingSupported
public DBDatabaseInfo.ResizingSupported getResizingSupported()
-
getColumnDefinitionMesageFormat
public java.lang.String getColumnDefinitionMesageFormat()
-
isPropertyReadOnly
public boolean isPropertyReadOnly(java.lang.String propName)
-
setPropertyReadOnly
public final void setPropertyReadOnly(java.lang.String propName, boolean b)
-
addToModel
public void addToModel(java.lang.String parentID, DBItemsCache cache)
- Specified by:
addToModel
in interfaceAbstractInfo
-
removeFromModel
public void removeFromModel(java.lang.String parentID, DBItemsCache cache)
- Specified by:
removeFromModel
in interfaceAbstractInfo
-
removePropertyChangeListener
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes PropertyChangeListener from the list of listeners.- Parameters:
listener
- The listener to remove.
-
firePropertyChange
protected void firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
Notifies all registered listeners about the event.
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-