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 classDBColInfo.ImplementationType
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringPROP_CHEMICAL_TERMS_FORMULAstatic java.lang.StringPROP_COLUMN_DEFINITIONstatic java.lang.StringPROP_COLUMN_NAMEstatic java.lang.StringPROP_DEFAULT_VALUEstatic java.lang.StringPROP_FIELDstatic java.lang.StringPROP_JDBC_TYPEstatic java.lang.StringPROP_LENGTHstatic java.lang.StringPROP_REQUIREDstatic java.lang.StringPROP_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 voidaddToModel(java.lang.String parentID, DBItemsCache cache)booleanequals(java.lang.Object obj)protected voidfirePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)Notifies all registered listeners about the event.java.lang.StringgetColumnDefinition()Get the current column definition for the particular database type.java.lang.StringgetColumnDefinitionMesageFormat()java.lang.StringgetColumnName()Getter for property columnName.DBDatabaseInfo.ColumnSQLTypegetColumnType()java.lang.StringgetDefaultValue()Getter for property defaultValue.DBColInfo.ImplementationTypegetImplementationType()intgetJdbcType()Getter for property jdbcType.intgetLength()Getter for property length.DBDatabaseInfo.NativeTypegetNativeType()java.lang.StringgetProperty(java.lang.String key)DBDatabaseInfo.ResizingSupportedgetResizingSupported()intgetScale()Getter for property scale.inthashCode()booleanisOracleTextIndexPresent()booleanisPropertyReadOnly(java.lang.String propName)booleanisRequired()NULL or NOT NULL.voidremoveFromModel(java.lang.String parentID, DBItemsCache cache)DBColInforemoveProperty(java.lang.String key)Remove a property.voidremovePropertyChangeListener(java.beans.PropertyChangeListener listener)Removes PropertyChangeListener from the list of listeners.voidsetPropertyReadOnly(java.lang.String propName, boolean b)java.lang.StringtoString()DBColInfoupdateProperties(java.util.Map<java.lang.String,java.lang.String> nue)DBColInfoupdateProperty(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:
addToModelin interfaceAbstractInfo
-
removeFromModel
public void removeFromModel(java.lang.String parentID, DBItemsCache cache)- Specified by:
removeFromModelin 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:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-