|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.tivoli.twg.engine.TWGDbColumn
com.tivoli.twg.engine.TWGDbDateColumn
TWGDbDateColumn is a container class that encapsulates a database table column where the column type is Date. This uses the java.sql.Date class which contains only the date fields, as opposed to java.date which has both date and time fields.
Constructor Summary | |
---|---|
TWGDbDateColumn(java.lang.String realName,
java.lang.String tokenName)
Create a date column TWGDbDateColumn. |
|
TWGDbDateColumn(TWGDbDateColumn copyCol)
Create a TWGDbDateColumn by copying another one |
Method Summary | |
---|---|
protected TWGDbColumn |
createFilterColumn(java.util.Locale loc,
TWGDatabaseTable table)
Create a filter version of this column (display name is translated). |
protected java.io.Serializable |
getDistinctValues(java.util.Locale loc,
TWGDatabaseTable table)
Get column distinct values (database engine use) |
long[] |
getValues()
Gets the array of distinct values for this column. |
protected void |
insertDistinctValue(java.lang.Object value)
This method is protected as an implementation side effect. |
protected void |
replaceDistinctValues(LongValueSet newValues)
This method is protected as an implementation side effect. |
protected void |
replaceDistinctValues(java.sql.ResultSet rs)
This method is protected as an implementation side effect. |
void |
setDefaultValue(java.sql.Date defaultValue)
Set a default value for this column. |
void |
setDefaultValue(long defaultValue)
Set a default value for this column. |
void |
setDefaultValue(java.lang.String defaultValue)
Set a default value for this column. |
void |
setDistinctValues(LongValueSet values)
Set the distinct values for this column to a constant set. |
protected void |
setDistinctValues(java.lang.Object vals)
Set distinct values (console use) |
void |
setInitialDistinctValues(TWGDate dv)
Set the initial distinct values for this column. |
void |
setInitialDistinctValues(TWGLong dv)
Set the initial distinct values for this column. |
void |
setInitialDistinctValues(TWGLongArray dv)
Set the initial distinct values for this column. |
java.lang.String |
toString()
Convert column to String for debug |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public TWGDbDateColumn(java.lang.String realName, java.lang.String tokenName)
realName
- -- the actual column name for the tabletokenName
- -- a nickname used to refer to the column for allpublic TWGDbDateColumn(TWGDbDateColumn copyCol)
copyCol
- -- the column to be copiedMethod Detail |
protected TWGDbColumn createFilterColumn(java.util.Locale loc, TWGDatabaseTable table)
createFilterColumn
in class TWGDbColumn
loc
- - the locale to use for translationstable
- - the TWGDatabaseTable that this column belongs to
public void setDefaultValue(long defaultValue)
defaultValue
- - the date represented as a long (number of milliseconds
from midnight, GMT, January 1st, 1970)public void setDefaultValue(java.sql.Date defaultValue)
defaultValue
- - the value as a java.sql.Date objectpublic void setDefaultValue(java.lang.String defaultValue)
defaultValue
- - the value as a string in yyyy-mm-dd formatprotected java.io.Serializable getDistinctValues(java.util.Locale loc, TWGDatabaseTable table)
getDistinctValues
in class TWGDbColumn
protected void setDistinctValues(java.lang.Object vals)
setDistinctValues
in class TWGDbColumn
protected void replaceDistinctValues(java.sql.ResultSet rs) throws TWGDbException
Replace the saved list of distinct values with a new set from a database query.
replaceDistinctValues
in class TWGDbColumn
rs
- - The query ResultSet.
TWGDbException
protected void replaceDistinctValues(LongValueSet newValues)
Replace the saved list of distinct values with a new set from a database query.
newValues
- - The LongValueSet containing the new valuesLongValueSet
protected void insertDistinctValue(java.lang.Object value) throws TWGDbException
Insert a distinct date value into the list of distinct values.
insertDistinctValue
in class TWGDbColumn
value
- - The value to be inserted.
-
- TWGDbException
TWGDbException
public long[] getValues()
public void setDistinctValues(LongValueSet values)
This method should be called only in the create method of a TWGDatabaseTable subclass when defining the table
values
- - The LongValueSet array containing the constant distinct valuesLongValueSet
public void setInitialDistinctValues(TWGLong dv)
dv
- - TWGLong datavaluepublic void setInitialDistinctValues(TWGLongArray dv)
dv
- - TWGLongArray datavaluepublic void setInitialDistinctValues(TWGDate dv)
dv
- - TWGDate datavaluepublic java.lang.String toString()
toString
in class TWGDbColumn
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |