Class SqlColumn
java.lang.Object
com.randomnoun.common.jexl.sql.SqlColumn
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThese constants are copied directly from the java.sql.Types class; note that we also add the new types MONEYVALUE, DATEVALUE, TIMEVALUE, FIXEDDATEVALUE and FIXEDTIMEVALUEstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intThe range 5000-6000 is currently unused in java.sql.Types; (and doesn't look like it will ever be used), so I'm going to use this for custom types.static final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new column, of type VARCHARCreate a new column, with the supplied datatypeCreate a new column, in a specific table, of type VARCHARCreate a new column, in a specific table, with the supplied datatype -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the currency column of this SqlColumn, as supplied by setCurrencyCodeNameintRetrieves the data type of this SqlColumnEither returns the name of the currency column, or table + "." + currency name, if a table has been setEither returns the name of this column, or table + "." + name, if a table has been setgetName()Retrieves the name of this SqlColumn, as set by the constructorgetTable()Retrieves the table of this SqlColumn, as set by the constructorvoidsetCurrencyCodeName(String currencyCodeName) Sets the column name that contains the currency code, for a MONEYVALUE SqlColumn.toString()Retrieve a string representation of this column
-
Field Details
-
ARRAY
These constants are copied directly from the java.sql.Types class; note that we also add the new types MONEYVALUE, DATEVALUE, TIMEVALUE, FIXEDDATEVALUE and FIXEDTIMEVALUE- See Also:
-
BIGINT
- See Also:
-
BINARY
- See Also:
-
BIT
- See Also:
-
BLOB
- See Also:
-
BOOLEAN
- See Also:
-
CHAR
- See Also:
-
CLOB
- See Also:
-
DATALINK
- See Also:
-
DATE
- See Also:
-
DECIMAL
- See Also:
-
DISTINCT
- See Also:
-
DOUBLE
- See Also:
-
FLOAT
- See Also:
-
INTEGER
- See Also:
-
JAVA_OBJECT
- See Also:
-
LONGVARBINARY
- See Also:
-
LONGVARCHAR
- See Also:
-
NULL
- See Also:
-
NUMERIC
- See Also:
-
OTHER
- See Also:
-
REAL
- See Also:
-
REF
- See Also:
-
SMALLINT
- See Also:
-
STRUCT
- See Also:
-
TIME
- See Also:
-
TIMESTAMP
- See Also:
-
TINYINT
- See Also:
-
VARBINARY
- See Also:
-
VARCHAR
- See Also:
-
MONEYVALUE
The range 5000-6000 is currently unused in java.sql.Types; (and doesn't look like it will ever be used), so I'm going to use this for custom types. Anything in here is treated specially in SqlGenerator when converting to SQL.- See Also:
-
DATEVALUE
- See Also:
-
TIMEVALUE
- See Also:
-
FIXEDDATEVALUE
- See Also:
-
FIXEDTIMEVALUE
- See Also:
-
-
Constructor Details
-
SqlColumn
-
SqlColumn
-
SqlColumn
-
SqlColumn
Create a new column, in a specific table, with the supplied datatype- Parameters:
name- The name of the column in the databasetable- The name of the table in the database this column is indataType- The datatype of the column. Corresponds to one of the public static final int constants defined in this class.
-
-
Method Details
-
setCurrencyCodeName
Sets the column name that contains the currency code, for a MONEYVALUE SqlColumn. If a table has been specified for this column, then the currency is always sourced from the same table.- Parameters:
currencyCodeName- the column name that contains the currency code- Throws:
IllegalStateException- if this method is called for a non-MONEYVALUE SqlColumn
-
getName
-
getTable
-
getCurrencyCodeName
Retrieves the currency column of this SqlColumn, as supplied by setCurrencyCodeName -
getDataType
Retrieves the data type of this SqlColumn -
getFullName
Either returns the name of this column, or table + "." + name, if a table has been set -
getFullCurrencyCodeName
Either returns the name of the currency column, or table + "." + currency name, if a table has been set -
toString
-